From samane.shojaie at gmail.com  Tue Sep  1 05:30:28 2015
From: samane.shojaie at gmail.com (Seyedeh Samane Shojaei)
Date: Tue, 1 Sep 2015 11:30:28 +0800
Subject: [FieldTrip]  resting state tutorial
Message-ID: <CAEBQhqHSBrWR-AAnMcy3saH=4-va3J=gvpMQehUUo8Unz11GGQ@mail.gmail.com>

Dear all,
I am running tutorial "Whole brain connectivity and network analysis",
http://www.fieldtriptoolbox.org/tutorial/networkanalysis
I got an error when calling function "ft_sourceinterpolate" as follows:

??? Reference to non-existent field 'avg'.

Error in ==> getsubfield at 45
  s = s.(t{k});

Error in ==> ft_sourceinterpolate at 343
    if ~iscell(getsubfield(functional, cfg.parameter{i}))

I don't have any idea what the problem is! any suggestion will be
appreciated.

Regards,
Samane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150901/b9cb971d/attachment.htm>

From voxxys at gmail.com  Tue Sep  1 12:54:33 2015
From: voxxys at gmail.com (Ksenia Volkova)
Date: Tue, 1 Sep 2015 13:54:33 +0300
Subject: [FieldTrip] Fitting dipole to a topography: objective function
 is undefined at initial point
Message-ID: <CAL_z2XuwGfzAVZ=sEi32WLnYrN8rdJDhK==XZcW8J5UyHQEA9A@mail.gmail.com>

Dear fieldtrip users,

I have encountered a problem getting dipole fit to a topography observed on
consecutive time points. I have attempted to format the data appropriately
(Tzvetan, thank you for your help!), but the call to ft_dipolefitting function
returns the "Objective function is undefined at initial point" error both
during gridsearch and nonlinear search. What could be the cause of such
behavior? Could it be that electrode coordinates are somehow in a wrong
format (I have taken mine from an eeglab dataset) or would they anyway be
projected onto head surface and cause wrong results, but not an error?

Thank you in advance for any help.

Ksenia Volkova

Dear Ksenia,
> I would first start with the organization of the data in a format
> FieldTrip can sense.
> data = [];
> data.trial ={[chan x time]} % this is your elec x topography matrix, where
> topography is observed on consecutive time points
> data.time = [vector-number of time points];
> data.label = {?elec1?,?elec2? etc.} your electrode labels
> data.elec = this is key reflecting the position of the electrodes relative
> to the head
> Next, you have to compute a volume conduction model. How to do so is
> explained here:
> http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg?s[]=eeg&s[]=volume&s[]=conduction&s[]=model
> After this you can proceed with the dipole fitting which is explained for
> instance here:
> http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting#fit_a_dipole_model_to_the_meg_data
> Under cfg.latency you could specify the number of the topography you are
> interested in and under cfg.vol the BEM model you computed in the previous
> step. If you don#t have individual MRI
> you can use the standard BEM model located in the
> ~template/headmodel/standard_bem.mat. Note that before you do so you
> should coregister the headmodel with the electrodes using
> ft_electroderealign.
> Good luck
> tzvetan
>
> > Dear fieldtrip users,
> >
> > I wonder if you can help me out. I have a relatively simple problem:
> having a topography matrix (where rows correspond to topographies, and
> columns correspond to channels) I want to fit a dipole to each topography.
> I have looked through tutorials and documentation and I've seen this
> example
> http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit.
> Still, I can't figure out how I should use the toolbox to solve my problem.
> >
> > What would be the right arguments to call ft_dipolefitting with in my
> case? If I have EEG data, topography matrix and channel locations, what
> would be the easiest way to fit a dipole to each topography?
> >
> > Thank you in advance for any help.
> >
> > Ksenia Volkova
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150901/36c7fd87/attachment.htm>

From calbimarta at gmail.com  Tue Sep  1 16:08:02 2015
From: calbimarta at gmail.com (Marta Calbi)
Date: Tue, 1 Sep 2015 16:08:02 +0200
Subject: [FieldTrip] questions about artifact rejection tool and filtering
	after ICA
Message-ID: <CAEk_qMg9vEP37AtSGbn3HE+ka5PkV4rN9Yxqs9xnK7FVkD3Xog@mail.gmail.com>

Hi,

We have a question about the layout of artifact rejection tool.

We have EEG raw data file of each subject, recorded and filtered with
NetStation, and exported to Simple Binary Format.

As first step, in our preprocessing script, we define which are the
different experimental conditions and then we use ft_trialfun_general to
compute our epochs of interest.

After defining layout and neighbours, we proceed with artifact rejection
with ft_rejectartifact and we can select artifact for each epoch.

How could we have on the x-axis the absolute time of the recording and  not
only the lenght of the single epoch (in order to have a better look to some
details)?



And then we have a question about filtering after ICA.

We intend to do ERP and Alpha-oscillations analyses, and for this reason we
need also a 1-30Hz filter (normally used for rhythms).

We’re thinking about running ICA on our dataset filtered with 0.1Hz
high-pass filter, and after that filter the data with 1-30Hz,

but we know that Fieldtrip after preprocessing gives us epoched data, that
is not subject to be filtered, so how do you suggest to proceed?


Thanks!


-- 
Calbi Marta, Ph.D student
Dipartimento di Neuroscienze - Sezione di Fisiologia
Università di Parma
Via Volturno 39, I-43100 Parma, Italy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150901/4846ca6a/attachment.htm>

From jia.wu at yale.edu  Tue Sep  1 23:20:14 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Tue, 1 Sep 2015 21:20:14 +0000
Subject: [FieldTrip] beamformer on EEG data
In-Reply-To: <AA21F9F31911364596BE68CA1AAD8DA466E1DE72@x10-mbx13.yu.yale.edu>
References: <AA21F9F31911364596BE68CA1AAD8DA466E1DE72@x10-mbx13.yu.yale.edu>
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E1EF7E@x10-mbx13.yu.yale.edu>

Hi,

Here is the most problematic part of my analysis.

When I did not align electrode positions with headmodel, I was able to get interpolated source signal that resembled a brain.
http://imgur.com/bZkGqsk

However if I managed to align electrode positions with headmodel, (then build the correct leadfield), the interpolated source did not resemble a brain.
http://imgur.com/XQMyiQy

Anybody has a clue what was going on?

best,
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Wu, Jia [jia.wu at yale.edu]
Sent: Monday, August 31, 2015 4:33 PM
To: FieldTrip discussion list
Subject: [FieldTrip] beamformer on EEG data

Hi,
I'm new to the community and fieldtrip. I'm trying to use beamformer to do oscillatory source localization on some EEG data.

I thought I stumbled upon some tutorial specific on this top on the fieldtrip wiki, but I couldn't find it any more. Most source localization materials seem to be for MEG data. And I've been confused about the steps to build a correct headmodel, sourcemodel, leadfield based on only EEG information.

Anybody has a quick link to the tutorial? If such tutorial doesn't exist I will email the group about my specific questions.

best,
-jia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150901/3e6e151f/attachment.htm>

From azeez.adebimpe5 at gmail.com  Tue Sep  1 23:28:15 2015
From: azeez.adebimpe5 at gmail.com (Azeez Adebimpe)
Date: Tue, 1 Sep 2015 23:28:15 +0200
Subject: [FieldTrip] beamformer on EEG data
In-Reply-To: <AA21F9F31911364596BE68CA1AAD8DA466E1EF7E@x10-mbx13.yu.yale.edu>
References: <AA21F9F31911364596BE68CA1AAD8DA466E1DE72@x10-mbx13.yu.yale.edu>
 <AA21F9F31911364596BE68CA1AAD8DA466E1EF7E@x10-mbx13.yu.yale.edu>
Message-ID: <CAK9dbJYV2zB-=hZeWVSWzXr_X1x0JCU=FFaJHyMe94RMKwNt7Q@mail.gmail.com>

Hi Jia,

Do you interpolate on the same MRI you used for  construct headmodel?
Can you post your matlab code?

Azeez

On Tue, Sep 1, 2015 at 11:20 PM, Wu, Jia <jia.wu at yale.edu> wrote:

> Hi,
>
> Here is the most problematic part of my analysis.
>
> When I did not align electrode positions with headmodel, I was able to get
> interpolated source signal that resembled a brain.
> http://imgur.com/bZkGqsk
>
> However if I managed to align electrode positions with headmodel, (then
> build the correct leadfield), the interpolated source did not resemble a
> brain.
> http://imgur.com/XQMyiQy
>
> Anybody has a clue what was going on?
>
> best,
> -jia
> ------------------------------
> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
> on behalf of Wu, Jia [jia.wu at yale.edu]
> *Sent:* Monday, August 31, 2015 4:33 PM
> *To:* FieldTrip discussion list
> *Subject:* [FieldTrip] beamformer on EEG data
>
> Hi,
> I'm new to the community and fieldtrip. I'm trying to use beamformer to do
> oscillatory source localization on some EEG data.
>
> I thought I stumbled upon some tutorial specific on this top on the
> fieldtrip wiki, but I couldn't find it any more. Most source localization
> materials seem to be for MEG data. And I've been confused about the steps
> to build a correct headmodel, sourcemodel, leadfield based on only EEG
> information.
>
> Anybody has a quick link to the tutorial? If such tutorial doesn't exist I
> will email the group about my specific questions.
>
> best,
> -jia
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150901/fced5dc6/attachment.htm>

From r.oostenveld at donders.ru.nl  Wed Sep  2 14:14:27 2015
From: r.oostenveld at donders.ru.nl (Robert Oostenveld)
Date: Wed, 2 Sep 2015 14:14:27 +0200
Subject: [FieldTrip] General matlab script for cluster based permutation
	testing?
In-Reply-To: <CABaUQnyuWdD+HygKU5LhN=atc8BAX-AWDq4rzeXea8xvNqA4uA@mail.gmail.com>
References: <CABaUQnyuWdD+HygKU5LhN=atc8BAX-AWDq4rzeXea8xvNqA4uA@mail.gmail.com>
Message-ID: <E1816948-782D-4ED5-AB4A-A9ABBB0790A4@donders.ru.nl>

Hi Markus,

That is not something which is not is easily implemented in a single script. It requires a whole variety of functionality which is part of the FT toolbox (shuffling, clustering, bookeeping), but which cannot easily be used if your data is in another format. Perhaps you can reformat your data to make it FT-like.

best regards,
Robert



On 31 Aug 2015, at 13:56, Markus Gschwind <markus.gschwind at gmail.com> wrote:

> Dear all,
> 
> I wonder if someone could guide me how to use the cluster-based permutation testing after (Maris & Oostenvidle, 2007) on non-fieldtrip data, for example on simple matrices in matlab.
> 
> Or is there even a matlab script around?
> 
> Thanks in advance,
> Markus 
> 
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




From r.oostenveld at donders.ru.nl  Wed Sep  2 14:16:23 2015
From: r.oostenveld at donders.ru.nl (Robert Oostenveld)
Date: Wed, 2 Sep 2015 14:16:23 +0200
Subject: [FieldTrip] Fitting dipole to a topography: objective function
	is undefined at initial point
In-Reply-To: <CAL_z2XuwGfzAVZ=sEi32WLnYrN8rdJDhK==XZcW8J5UyHQEA9A@mail.gmail.com>
References: <CAL_z2XuwGfzAVZ=sEi32WLnYrN8rdJDhK==XZcW8J5UyHQEA9A@mail.gmail.com>
Message-ID: <6492E931-4F1C-49E7-A263-079AA40B3412@donders.ru.nl>

Hi Ksenia,

The message "Objective function is undefined at initial point” is not something from FieldTrip, but from MATLAB itself. Hence it also suggests that there is an underlying problem and not per see an issue with the organization of the data structures. 

I suggest you do “dbstop if error” on the command line, then start the call to ft_dipolefitting again and use the MATLAB debugger to further identify the cause of the error.

If that fails to provide additional insights, you could add 
cfg.debug = ‘saveonerror’ 
and share the matlab file that will be created on the detection of the error (http://www.fieldtriptoolbox.org/faq/how_should_i_send_example_data_to_the_developers).

best
Robert




On 01 Sep 2015, at 12:54, Ksenia Volkova <voxxys at gmail.com> wrote:

> Dear fieldtrip users,
> 
> I have encountered a problem getting dipole fit to a topography observed on consecutive time points. I have attempted to format the data appropriately (Tzvetan, thank you for your help!), but the call to ft_dipolefitting function returns the "Objective function is undefined at initial point" error both during gridsearch and nonlinear search. What could be the cause of such behavior? Could it be that electrode coordinates are somehow in a wrong format (I have taken mine from an eeglab dataset) or would they anyway be projected onto head surface and cause wrong results, but not an error?
> 
> Thank you in advance for any help.
> 
> Ksenia Volkova
> 
> Dear Ksenia,
> I would first start with the organization of the data in a format FieldTrip can sense.
> data = [];
> data.trial ={[chan x time]} % this is your elec x topography matrix, where topography is observed on consecutive time points
> data.time = [vector-number of time points];
> data.label = {?elec1?,?elec2? etc.} your electrode labels
> data.elec = this is key reflecting the position of the electrodes relative to the head
> Next, you have to compute a volume conduction model. How to do so is explained here: http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg?s[]=eeg&s[]=volume&s[]=conduction&s[]=model
> After this you can proceed with the dipole fitting which is explained for instance here: http://www.fieldtriptoolbox.org/tutorial/natmeg/dipolefitting#fit_a_dipole_model_to_the_meg_data
> Under cfg.latency you could specify the number of the topography you are interested in and under cfg.vol the BEM model you computed in the previous step. If you don#t have individual MRI
> you can use the standard BEM model located in the ~template/headmodel/standard_bem.mat. Note that before you do so you should coregister the headmodel with the electrodes using
> ft_electroderealign.
> Good luck
> tzvetan
> 
> > Dear fieldtrip users,
> >
> > I wonder if you can help me out. I have a relatively simple problem: having a topography matrix (where rows correspond to topographies, and columns correspond to channels) I want to fit a dipole to each topography. I have looked through tutorials and documentation and I've seen this example http://www.fieldtriptoolbox.org/example/compute_forward_simulated_data_and_apply_a_dipole_fit. Still, I can't figure out how I should use the toolbox to solve my problem.
> >
> > What would be the right arguments to call ft_dipolefitting with in my case? If I have EEG data, topography matrix and channel locations, what would be the easiest way to fit a dipole to each topography?
> >
> > Thank you in advance for any help.
> >
> > Ksenia Volkova
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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

From g.dipisa at gmail.com  Thu Sep  3 19:28:13 2015
From: g.dipisa at gmail.com (Grazia Di Pisa)
Date: Thu, 3 Sep 2015 19:28:13 +0200
Subject: [FieldTrip] ft_freqanalysis and optimal parameters for higher
	frequency
Message-ID: <C7F210CB-3691-4301-8285-1CDC48AF6426@gmail.com>

Hi all,

I’m doing time-frequency analysis based on multitapers since I’m trying to analyse activity in the gamma band frequency from 30 to 80 Hz.

I’m getting some strange plots and from the tutorial I don’t understand how to optimally choose some parameters, in particular for cfg.t_ftimwin and cfg.tapsmofrq.

Currently, I’m using the following:

cfg = [];
    cfg.output     = 'pow';
    cfg.channel    = 'EEG';
    cfg.method     = 'mtmconvol';
    cfg.toi        = [-1.0 : 0.05 : 2.5]; 
    cfg.foi        = [30:2:80]; 
    cfg.t_ftimwin  = 5./cfg.foi;  
    cfg.tapsmofrq  = 0.4*cfg.foi; 

Sorry for the very basic question, but I’m a beginner so some explanations and suggestions would be really helpful!

Thanks in advance,
~ grazia




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

From francois.tadel at mcgill.ca  Fri Sep  4 17:17:31 2015
From: francois.tadel at mcgill.ca (=?UTF-8?Q?Fran=c3=a7ois_Tadel?=)
Date: Fri, 4 Sep 2015 11:17:31 -0400
Subject: [FieldTrip] FieldTrip version
Message-ID: <55E9B60B.2020803@mcgill.ca>

Hello,

We're currently writing wrappers to call FieldTrip functions from the 
Brainstorm pipeline editor.
For bookkeeping, we would like to save in the database the version of 
FieldTrip that was used to create the files.

I'm having trouble with the function ft_version:
     >> [ftver, ftpath] = ft_version
     Reference to non-existent element of a cell array.
     Error in ft_version (line 155)
             rev = rev{1}{1};

The file signature.md5 contains the following text:
     <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
     <html><head>
     <title>301 Moved Permanently</title>
     </head><body>
     <h1>Moved Permanently</h1>
     <p>The document has moved <a 
href="http://www.fieldtriptoolbox.org/signature.md5">here</a>.</p>
     </body></html>

How can I get the version of FieldTrip in a reliable way?

Thanks,
Francois

-- 
François Tadel, MSc
MEG / McConnell Brain Imaging Center / MNI / McGill University
3801 rue University, Montreal, QC H3A2B4, Canada



From jia.wu at yale.edu  Fri Sep  4 17:17:47 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Fri, 4 Sep 2015 15:17:47 +0000
Subject: [FieldTrip] beamformer on EEG data
In-Reply-To: <CAK9dbJYV2zB-=hZeWVSWzXr_X1x0JCU=FFaJHyMe94RMKwNt7Q@mail.gmail.com>
References: <AA21F9F31911364596BE68CA1AAD8DA466E1DE72@x10-mbx13.yu.yale.edu>
 <AA21F9F31911364596BE68CA1AAD8DA466E1EF7E@x10-mbx13.yu.yale.edu>,
 <CAK9dbJYV2zB-=hZeWVSWzXr_X1x0JCU=FFaJHyMe94RMKwNt7Q@mail.gmail.com>
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E1F25F@x10-mbx13.yu.yale.edu>

Azeez,

Thanks for getting back to me. Yes I used the same MRI. But since you asked, I went back and double checked all the steps and put together the code as below. I used MRIcro to looked at the source output. The output still doesn't look quite like a brain: http://imgur.com/Kn3sbgm.

Code is here:
https://github.com/sindhri/try_fieldtrip/blob/master/run_data_sample_sent.m

sample data here: (sorry the link expires in a week)
download password:code
https://files.yale.edu/public_download?shareId=40d6f4c574599585eecaef773c7b927e

Thank you very much for your help!

best,
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Azeez Adebimpe [azeez.adebimpe5 at gmail.com]
Sent: Tuesday, September 01, 2015 5:28 PM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] beamformer on EEG data

Hi Jia,

Do you interpolate on the same MRI you used for  construct headmodel?
Can you post your matlab code?

Azeez

On Tue, Sep 1, 2015 at 11:20 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
Hi,

Here is the most problematic part of my analysis.

When I did not align electrode positions with headmodel, I was able to get interpolated source signal that resembled a brain.
http://imgur.com/bZkGqsk<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_bZkGqsk&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=Pq7HZiQsFtOT9Nl4SPperxlyaBByDsKFHyM5S32q0DE&e=>

However if I managed to align electrode positions with headmodel, (then build the correct leadfield), the interpolated source did not resemble a brain.
http://imgur.com/XQMyiQy<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_XQMyiQy&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=2nXDThp6Y65bF1-enB75g9fYxxFO6z3poQIyctjGq-Y&e=>

Anybody has a clue what was going on?

best,
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Wu, Jia [jia.wu at yale.edu<mailto:jia.wu at yale.edu>]
Sent: Monday, August 31, 2015 4:33 PM
To: FieldTrip discussion list
Subject: [FieldTrip] beamformer on EEG data

Hi,
I'm new to the community and fieldtrip. I'm trying to use beamformer to do oscillatory source localization on some EEG data.

I thought I stumbled upon some tutorial specific on this top on the fieldtrip wiki, but I couldn't find it any more. Most source localization materials seem to be for MEG data. And I've been confused about the steps to build a correct headmodel, sourcemodel, leadfield based on only EEG information.

Anybody has a quick link to the tutorial? If such tutorial doesn't exist I will email the group about my specific questions.

best,
-jia

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=SDcXU6EPMuaMwjujbNEU9iuxnVYcl7-xguabqlYxQSE&e=>

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

From m.p.craddock at leeds.ac.uk  Fri Sep  4 17:22:52 2015
From: m.p.craddock at leeds.ac.uk (Matt Craddock)
Date: Fri, 4 Sep 2015 16:22:52 +0100
Subject: [FieldTrip] ft_freqanalysis and optimal parameters for higher
 frequency
In-Reply-To: <C7F210CB-3691-4301-8285-1CDC48AF6426@gmail.com>
References: <C7F210CB-3691-4301-8285-1CDC48AF6426@gmail.com>
Message-ID: <55E9B74C.3080803@leeds.ac.uk>

On 03/09/2015 18:28, Grazia Di Pisa wrote:
> Hi all,
>
> I’m doing time-frequency analysis based on multitapers since I’m trying
> to analyse activity in the gamma band frequency from 30 to 80 Hz.
>
> I’m getting some strange plots and from the tutorial I don’t understand
> how to optimally choose some parameters, in particular for cfg.t_ftimwin
> and cfg.tapsmofrq.
>
> Currently, I’m using the following:
>
> cfg = [];
>      cfg.output     = 'pow';
>      cfg.channel    = 'EEG';
>      cfg.method     = 'mtmconvol';
>      cfg.toi        = [-1.0 : 0.05 : 2.5];
>      cfg.foi        = [30:2:80];
>      cfg.t_ftimwin  = 5./cfg.foi;
>      cfg.tapsmofrq  = 0.4*cfg.foi;
>
> Sorry for the very basic question, but I’m a beginner so some
> explanations and suggestions would be really helpful!
>
> Thanks in advance,
> ~ grazia
>

Hi Grazia,

without seeing the plots it's a little difficult to be sure what you 
mean by strange.

The parameters are fine in the sense that they will work. They're set to 
scale the length of the time window and the amount of frequency 
smoothing by frequency. So as frequency increases, the time window 
shortens (and thus frequency precision decreases), and the amount of 
smoothing increases as well. The length of the time window is an integer 
number of cycles at that frequency; so in this case, the time window is 
5 cycles at each frequency. You could try a higher number of cycles; 
with Morlet wavelets, 7 cycles are often used for high frequency 
activity, so maybe try 7. Also, the amount of smoothing scales here such 
that at 80 Hz you have 32 Hz of smoothing... that seems a little 
excessive to me.

Often you'll find when people use multitapers to analyze gamma they'll 
use fixed rather than scaling time windows and smoothing. So for 
example, you could set:

cfg.t_ftimwin(1:length(cfg.foi)) = 0.2;
cfg.tapsmofrq(1:length(cfg.foi)) = 10;

to use a fixed window length of 200 ms and smoothing of 10 Hz. I usually 
do it this way. to check the frequency resolution of the window, divide 
1 by it. So here, it's 1/.2 = 5 Hz. The smoothing should be a multiple 
of this, so 10, 15, 20 and so on. 2 or 3 times the resolution should be 
OK, so 10 or 15 with a window of .2s.

It's hard to say what's optimal as that depends on the nature of the 
signal, but generally with settings like the above you'll probably see 
something if anything is there

If you're looking at gamma band with the EEG, be *extremely* wary of 
miniature eye movement artefacts. See...

Keren, A. S., Yuval-Greenberg, S., & Deouell, L. Y. (2010). Saccadic 
spike potentials in gamma-band EEG: Characterization, detection and 
suppression. NeuroImage, 49(3), 2248–2263. 
http://doi.org/10.1016/j.neuroimage.2009.10.057

Hassler, U., Barreto, N. T., & Gruber, T. (2011). Induced gamma band 
responses in human EEG after the control of miniature saccadic 
artifacts. NeuroImage, 57(54), 1411–1421. 
http://doi.org/10.1016/j.neuroimage.2011.05.062

...and my eeglab plugin here: https://github.com/craddm/microDetect

Cheers,
Matt

-- 
Dr Matt Craddock
Research Fellow
School of Psychology
University of Leeds
Tel: +44 113 3430540


From azeez.adebimpe5 at gmail.com  Fri Sep  4 17:36:42 2015
From: azeez.adebimpe5 at gmail.com (Azeez Adebimpe)
Date: Fri, 4 Sep 2015 17:36:42 +0200
Subject: [FieldTrip] beamformer on EEG data
In-Reply-To: <AA21F9F31911364596BE68CA1AAD8DA466E1F25F@x10-mbx13.yu.yale.edu>
References: <AA21F9F31911364596BE68CA1AAD8DA466E1DE72@x10-mbx13.yu.yale.edu>
 <AA21F9F31911364596BE68CA1AAD8DA466E1EF7E@x10-mbx13.yu.yale.edu>
 <CAK9dbJYV2zB-=hZeWVSWzXr_X1x0JCU=FFaJHyMe94RMKwNt7Q@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F25F@x10-mbx13.yu.yale.edu>
Message-ID: <CAK9dbJbzLr7X8101EGu0031yoQ2JdrsUidNhLGuat5tWRbQKGg@mail.gmail.com>

Hi Jia,

There  may be problem in viewing if there is no issues or warning in
headmodel construction.
Can you use view in fieldtrip first  with* ft_sourceplot* after  or before
interpolation to compare  with micron?

Azeez



On Fri, Sep 4, 2015 at 5:17 PM, Wu, Jia <jia.wu at yale.edu> wrote:

> Azeez,
>
> Thanks for getting back to me. Yes I used the same MRI. But since you
> asked, I went back and double checked all the steps and put together the
> code as below. I used MRIcro to looked at the source output. The output
> still doesn't look quite like a brain: http://imgur.com/Kn3sbgm.
>
> Code is here:
> https://github.com/sindhri/try_fieldtrip/blob/master/run_data_sample_sent.m
>
> sample data here: (sorry the link expires in a week)
> download password:code
>
> https://files.yale.edu/public_download?shareId=40d6f4c574599585eecaef773c7b927e
>
> Thank you very much for your help!
>
> best,
> -jia
> ------------------------------
> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
> on behalf of Azeez Adebimpe [azeez.adebimpe5 at gmail.com]
> *Sent:* Tuesday, September 01, 2015 5:28 PM
> *To:* FieldTrip discussion list
> *Subject:* Re: [FieldTrip] beamformer on EEG data
>
> Hi Jia,
>
> Do you interpolate on the same MRI you used for  construct headmodel?
> Can you post your matlab code?
>
> Azeez
>
> On Tue, Sep 1, 2015 at 11:20 PM, Wu, Jia <jia.wu at yale.edu> wrote:
>
>> Hi,
>>
>> Here is the most problematic part of my analysis.
>>
>> When I did not align electrode positions with headmodel, I was able to
>> get interpolated source signal that resembled a brain.
>> http://imgur.com/bZkGqsk
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_bZkGqsk&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=Pq7HZiQsFtOT9Nl4SPperxlyaBByDsKFHyM5S32q0DE&e=>
>>
>> However if I managed to align electrode positions with headmodel, (then
>> build the correct leadfield), the interpolated source did not resemble a
>> brain.
>> http://imgur.com/XQMyiQy
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_XQMyiQy&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=2nXDThp6Y65bF1-enB75g9fYxxFO6z3poQIyctjGq-Y&e=>
>>
>> Anybody has a clue what was going on?
>>
>> best,
>> -jia
>> ------------------------------
>> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
>> on behalf of Wu, Jia [jia.wu at yale.edu]
>> *Sent:* Monday, August 31, 2015 4:33 PM
>> *To:* FieldTrip discussion list
>> *Subject:* [FieldTrip] beamformer on EEG data
>>
>> Hi,
>> I'm new to the community and fieldtrip. I'm trying to use beamformer to
>> do oscillatory source localization on some EEG data.
>>
>> I thought I stumbled upon some tutorial specific on this top on the
>> fieldtrip wiki, but I couldn't find it any more. Most source localization
>> materials seem to be for MEG data. And I've been confused about the steps
>> to build a correct headmodel, sourcemodel, leadfield based on only EEG
>> information.
>>
>> Anybody has a quick link to the tutorial? If such tutorial doesn't exist
>> I will email the group about my specific questions.
>>
>> best,
>> -jia
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=SDcXU6EPMuaMwjujbNEU9iuxnVYcl7-xguabqlYxQSE&e=>
>>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150904/238fe193/attachment.htm>

From jia.wu at yale.edu  Sun Sep  6 04:10:44 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Sun, 6 Sep 2015 02:10:44 +0000
Subject: [FieldTrip] beamformer on EEG data
In-Reply-To: <CAK9dbJbzLr7X8101EGu0031yoQ2JdrsUidNhLGuat5tWRbQKGg@mail.gmail.com>
References: <AA21F9F31911364596BE68CA1AAD8DA466E1DE72@x10-mbx13.yu.yale.edu>
 <AA21F9F31911364596BE68CA1AAD8DA466E1EF7E@x10-mbx13.yu.yale.edu>
 <CAK9dbJYV2zB-=hZeWVSWzXr_X1x0JCU=FFaJHyMe94RMKwNt7Q@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F25F@x10-mbx13.yu.yale.edu>,
 <CAK9dbJbzLr7X8101EGu0031yoQ2JdrsUidNhLGuat5tWRbQKGg@mail.gmail.com>
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E1F330@x10-mbx13.yu.yale.edu>

Azeez
Thanks for getting back to me. I used ft_sourceplot and it always looked fine no matter what I put in.  When I used unaligned net position and headmodel there is no warning while running scripts regarding it. I'm just really concerned that something went wrong and the signal I was mapping was from a completely wrong part of the brain.
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Azeez Adebimpe [azeez.adebimpe5 at gmail.com]
Sent: Friday, September 04, 2015 11:36 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] beamformer on EEG data

Hi Jia,

There  may be problem in viewing if there is no issues or warning in headmodel construction.
Can you use view in fieldtrip first  with ft_sourceplot after  or before interpolation to compare  with micron?

Azeez



On Fri, Sep 4, 2015 at 5:17 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
Azeez,

Thanks for getting back to me. Yes I used the same MRI. But since you asked, I went back and double checked all the steps and put together the code as below. I used MRIcro to looked at the source output. The output still doesn't look quite like a brain: http://imgur.com/Kn3sbgm.<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_Kn3sbgm.&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=vgnpwQD5TlKRzVO4m-lQwR08lEmpPNrKkeKHx27rmhI&s=2DWDnT6nVX0DpGqntWy_5IUNtt5OFEJQZloL_ldDxec&e=>

Code is here:
https://github.com/sindhri/try_fieldtrip/blob/master/run_data_sample_sent.m<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sindhri_try-5Ffieldtrip_blob_master_run-5Fdata-5Fsample-5Fsent.m&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=vgnpwQD5TlKRzVO4m-lQwR08lEmpPNrKkeKHx27rmhI&s=lFRgT-Sr8abQl8cd0_eruwtbpdP_3srp7OiXMUZs1KE&e=>

sample data here: (sorry the link expires in a week)
download password:code
https://files.yale.edu/public_download?shareId=40d6f4c574599585eecaef773c7b927e

Thank you very much for your help!

best,
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Azeez Adebimpe [azeez.adebimpe5 at gmail.com<mailto:azeez.adebimpe5 at gmail.com>]
Sent: Tuesday, September 01, 2015 5:28 PM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] beamformer on EEG data

Hi Jia,

Do you interpolate on the same MRI you used for  construct headmodel?
Can you post your matlab code?

Azeez

On Tue, Sep 1, 2015 at 11:20 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
Hi,

Here is the most problematic part of my analysis.

When I did not align electrode positions with headmodel, I was able to get interpolated source signal that resembled a brain.
http://imgur.com/bZkGqsk<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_bZkGqsk&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=Pq7HZiQsFtOT9Nl4SPperxlyaBByDsKFHyM5S32q0DE&e=>

However if I managed to align electrode positions with headmodel, (then build the correct leadfield), the interpolated source did not resemble a brain.
http://imgur.com/XQMyiQy<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_XQMyiQy&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=2nXDThp6Y65bF1-enB75g9fYxxFO6z3poQIyctjGq-Y&e=>

Anybody has a clue what was going on?

best,
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Wu, Jia [jia.wu at yale.edu<mailto:jia.wu at yale.edu>]
Sent: Monday, August 31, 2015 4:33 PM
To: FieldTrip discussion list
Subject: [FieldTrip] beamformer on EEG data

Hi,
I'm new to the community and fieldtrip. I'm trying to use beamformer to do oscillatory source localization on some EEG data.

I thought I stumbled upon some tutorial specific on this top on the fieldtrip wiki, but I couldn't find it any more. Most source localization materials seem to be for MEG data. And I've been confused about the steps to build a correct headmodel, sourcemodel, leadfield based on only EEG information.

Anybody has a quick link to the tutorial? If such tutorial doesn't exist I will email the group about my specific questions.

best,
-jia

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=SDcXU6EPMuaMwjujbNEU9iuxnVYcl7-xguabqlYxQSE&e=>


_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=vgnpwQD5TlKRzVO4m-lQwR08lEmpPNrKkeKHx27rmhI&s=icp3IlgY7tb8LtTMtfPwmBAMLtKnFkwb6w1FX-oJXlA&e=>

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

From jorn at artinis.com  Mon Sep  7 09:59:11 2015
From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=)
Date: Mon, 7 Sep 2015 09:59:11 +0200
Subject: [FieldTrip] FieldTrip version
In-Reply-To: <55E9B60B.2020803@mcgill.ca>
References: <55E9B60B.2020803@mcgill.ca>
Message-ID: <00d401d0e943$15095c40$3f1c14c0$@artinis.com>

Dear Francois,

it works fine for me:
>> cd fieldtrip\
>> ft_defaults
Warning: FieldTrip is not yet on your MATLAB path, adding C:\Users\Jörn\Documents\MATLAB\fieldtrip 
> In ft_defaults at 88 
>> [a, b] = ft_version

a =

r10653


b =

C:\Users\Jörn\Documents\MATLAB\fieldtrip


Did you call ft_defaults before trying to use ft_version?

Best,
Jörn
--

Jörn M. Horschig, PhD, Software Engineer
Artinis Medical Systems  |  +31 481 350 980 

> -----Original Message-----
> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-
> bounces at science.ru.nl] On Behalf Of François Tadel
> Sent: Friday, September 4, 2015 5:18 PM
> To: fieldtrip at science.ru.nl
> Subject: [FieldTrip] FieldTrip version
> 
> Hello,
> 
> We're currently writing wrappers to call FieldTrip functions from the
> Brainstorm pipeline editor.
> For bookkeeping, we would like to save in the database the version of
> FieldTrip that was used to create the files.
> 
> I'm having trouble with the function ft_version:
>      >> [ftver, ftpath] = ft_version
>      Reference to non-existent element of a cell array.
>      Error in ft_version (line 155)
>              rev = rev{1}{1};
> 
> The file signature.md5 contains the following text:
>      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>      <html><head>
>      <title>301 Moved Permanently</title>
>      </head><body>
>      <h1>Moved Permanently</h1>
>      <p>The document has moved <a
> href="http://www.fieldtriptoolbox.org/signature.md5">here</a>.</p>
>      </body></html>
> 
> How can I get the version of FieldTrip in a reliable way?
> 
> Thanks,
> Francois
> 
> --
> François Tadel, MSc
> MEG / McConnell Brain Imaging Center / MNI / McGill University
> 3801 rue University, Montreal, QC H3A2B4, Canada
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




From stephen.whitmarsh at ki.se  Mon Sep  7 12:24:12 2015
From: stephen.whitmarsh at ki.se (Stephen Whitmarsh)
Date: Mon, 7 Sep 2015 10:24:12 +0000
Subject: [FieldTrip] Memory-efficient t-testing against zero (or any scalar)
Message-ID: <bc69732983634a32b3134a66b155376b@EXPRD03.hosting.ru.nl>

Dear Fieldtrippers,

I’ve been hitting a pretty high memory ceiling, so I’m trying to reduce the use of RAM as much as possible.

I am at the point of using (source)statistics, in which I need to (t-)test against zero. Normally, I would just create dummy FT data-structures, in which I replace the parameter that is tested with 0. However, in my case this would result in an asphyxiating (more than) doubling of data in memory.

Has anyone already created a ft_statfun that simply tests against a scalar (for all data points)? Or, if I would need to write my own, which existing ft_statfun would be most convenient do you think? Or perhaps there is another way around it?

Thanks!
Stephen


Stephen Whitmarsh, PhD
PostDoctoral Researcher | NatMEG

Swedish National Facility for
Magnetoencephalography
Office: +46 (0)8 524 833 33
MEG lab: +46 (0)8 524 833 09
stephen at NatMEG.se | NatMEG.se

[NatMEG_POS_resized]

Karolinska Institutet
Department of Clinical Neuroscience
Nobels väg 9, D2:240 | 171 77 Stockholm
Stephen.Whitmarsh at ki.se | ki.se


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

From azeez.adebimpe5 at gmail.com  Tue Sep  8 08:53:51 2015
From: azeez.adebimpe5 at gmail.com (Azeez Adebimpe)
Date: Tue, 8 Sep 2015 08:53:51 +0200
Subject: [FieldTrip] beamformer on EEG data
In-Reply-To: <AA21F9F31911364596BE68CA1AAD8DA466E1F330@x10-mbx13.yu.yale.edu>
References: <AA21F9F31911364596BE68CA1AAD8DA466E1DE72@x10-mbx13.yu.yale.edu>
 <AA21F9F31911364596BE68CA1AAD8DA466E1EF7E@x10-mbx13.yu.yale.edu>
 <CAK9dbJYV2zB-=hZeWVSWzXr_X1x0JCU=FFaJHyMe94RMKwNt7Q@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F25F@x10-mbx13.yu.yale.edu>
 <CAK9dbJbzLr7X8101EGu0031yoQ2JdrsUidNhLGuat5tWRbQKGg@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F330@x10-mbx13.yu.yale.edu>
Message-ID: <CAK9dbJaLEwa6Z45_s9VjGjuE76YxsW41KXv_8W-yusr83Yu3Qw@mail.gmail.com>

Hi Jia,

Can you ft_volumewrite instead of ft_sourcewrite  after interpolation

Azeez

On Sun, Sep 6, 2015 at 4:10 AM, Wu, Jia <jia.wu at yale.edu> wrote:

> Azeez
> Thanks for getting back to me. I used ft_sourceplot and it always looked
> fine no matter what I put in.  When I used unaligned net position and
> headmodel there is no warning while running scripts regarding it. I'm just
> really concerned that something went wrong and the signal I was mapping was
> from a completely wrong part of the brain.
> -jia
> ------------------------------
> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
> on behalf of Azeez Adebimpe [azeez.adebimpe5 at gmail.com]
> *Sent:* Friday, September 04, 2015 11:36 AM
> *To:* FieldTrip discussion list
> *Subject:* Re: [FieldTrip] beamformer on EEG data
>
> Hi Jia,
>
> There  may be problem in viewing if there is no issues or warning in
> headmodel construction.
> Can you use view in fieldtrip first  with* ft_sourceplot* after  or
> before interpolation to compare  with micron?
>
> Azeez
>
>
>
> On Fri, Sep 4, 2015 at 5:17 PM, Wu, Jia <jia.wu at yale.edu> wrote:
>
>> Azeez,
>>
>> Thanks for getting back to me. Yes I used the same MRI. But since you
>> asked, I went back and double checked all the steps and put together the
>> code as below. I used MRIcro to looked at the source output. The output
>> still doesn't look quite like a brain: http://imgur.com/Kn3sbgm.
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_Kn3sbgm.&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=vgnpwQD5TlKRzVO4m-lQwR08lEmpPNrKkeKHx27rmhI&s=2DWDnT6nVX0DpGqntWy_5IUNtt5OFEJQZloL_ldDxec&e=>
>>
>> Code is here:
>>
>> https://github.com/sindhri/try_fieldtrip/blob/master/run_data_sample_sent.m
>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sindhri_try-5Ffieldtrip_blob_master_run-5Fdata-5Fsample-5Fsent.m&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=vgnpwQD5TlKRzVO4m-lQwR08lEmpPNrKkeKHx27rmhI&s=lFRgT-Sr8abQl8cd0_eruwtbpdP_3srp7OiXMUZs1KE&e=>
>>
>> sample data here: (sorry the link expires in a week)
>> download password:code
>>
>> https://files.yale.edu/public_download?shareId=40d6f4c574599585eecaef773c7b927e
>>
>> Thank you very much for your help!
>>
>> best,
>> -jia
>> ------------------------------
>> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
>> on behalf of Azeez Adebimpe [azeez.adebimpe5 at gmail.com]
>> *Sent:* Tuesday, September 01, 2015 5:28 PM
>> *To:* FieldTrip discussion list
>> *Subject:* Re: [FieldTrip] beamformer on EEG data
>>
>> Hi Jia,
>>
>> Do you interpolate on the same MRI you used for  construct headmodel?
>> Can you post your matlab code?
>>
>> Azeez
>>
>> On Tue, Sep 1, 2015 at 11:20 PM, Wu, Jia <jia.wu at yale.edu> wrote:
>>
>>> Hi,
>>>
>>> Here is the most problematic part of my analysis.
>>>
>>> When I did not align electrode positions with headmodel, I was able to
>>> get interpolated source signal that resembled a brain.
>>> http://imgur.com/bZkGqsk
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_bZkGqsk&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=Pq7HZiQsFtOT9Nl4SPperxlyaBByDsKFHyM5S32q0DE&e=>
>>>
>>> However if I managed to align electrode positions with headmodel, (then
>>> build the correct leadfield), the interpolated source did not resemble a
>>> brain.
>>> http://imgur.com/XQMyiQy
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_XQMyiQy&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=2nXDThp6Y65bF1-enB75g9fYxxFO6z3poQIyctjGq-Y&e=>
>>>
>>> Anybody has a clue what was going on?
>>>
>>> best,
>>> -jia
>>> ------------------------------
>>> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
>>> on behalf of Wu, Jia [jia.wu at yale.edu]
>>> *Sent:* Monday, August 31, 2015 4:33 PM
>>> *To:* FieldTrip discussion list
>>> *Subject:* [FieldTrip] beamformer on EEG data
>>>
>>> Hi,
>>> I'm new to the community and fieldtrip. I'm trying to use beamformer to
>>> do oscillatory source localization on some EEG data.
>>>
>>> I thought I stumbled upon some tutorial specific on this top on the
>>> fieldtrip wiki, but I couldn't find it any more. Most source localization
>>> materials seem to be for MEG data. And I've been confused about the steps
>>> to build a correct headmodel, sourcemodel, leadfield based on only EEG
>>> information.
>>>
>>> Anybody has a quick link to the tutorial? If such tutorial doesn't exist
>>> I will email the group about my specific questions.
>>>
>>> best,
>>> -jia
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl
>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=SDcXU6EPMuaMwjujbNEU9iuxnVYcl7-xguabqlYxQSE&e=>
>>>
>>
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=vgnpwQD5TlKRzVO4m-lQwR08lEmpPNrKkeKHx27rmhI&s=icp3IlgY7tb8LtTMtfPwmBAMLtKnFkwb6w1FX-oJXlA&e=>
>>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150908/f2c76829/attachment.htm>

From M.vanEs at donders.ru.nl  Tue Sep  8 10:43:46 2015
From: M.vanEs at donders.ru.nl (Es, M.W.J. van (Mats))
Date: Tue, 8 Sep 2015 08:43:46 +0000
Subject: [FieldTrip] ft_timelockstatistics crossvalidate alternative
Message-ID: <3FC79061C73BEF44A3BEDA5DFC0ADBDF12EE8428@exprd01.hosting.ru.nl>

Dear FieldTrippers,

For my master's project I am trying to classify my MEG data on the orientation of a grating-stimulus (presented for 1sec). I do this in a time-resolved manner so I get the classifier accuracy over time, which means I classify on 20ms windows and slide this window every 2.5ms. Up till now I used the cfg.method = 'crossvalidate' in ft_timelockstatistics (so, five fold crossvalidation). My question now is as follows:

instead of training on 80% of the trials and testing on 20% of the trials for the selected time window, I want to train the classifier on the whole second the stimulus is on-screen (except the selected time-window) and then test it on the selected timewindow. Moreover, i want to do this for two cases:
- independent for each trial. So for each trial train on the 1sec window (of only that trial) and test on the selected 20ms window (of that trial).
- for all trials together. Train on the 1sec window of all trials, test on the selected 20ms window of all trials.

So in short, I'm looking for a way to tell the classifier what to train on and what to test on.



For completeness, I'm using the latest fieldtrip on the torque cluster with matlab2015a.
after ft_timelockanalysis, I've been using the following code:
    cfg         = [];
    cfg.layout  = 'CTF275.lay';
    cfg.method  = 'crossvalidate';
    cfg.nfolds = 5;
    cfg.design  = [ones(size(counterclockwise.trial,1),1); 2*ones(size(clockwise.trial,1),1)]';
    cfg.latency     = [tBegin tBegin+0.02]; % 20ms window
    cfg.statistic = {'accuracy' 'binomial' 'contingency'};
    stat = ft_timelockstatistics(cfg,counterclockwise, clockwise);


Thank you for your help!
Mats van Es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150908/c60d874d/attachment.htm>

From sarathykousik at gmail.com  Tue Sep  8 12:41:14 2015
From: sarathykousik at gmail.com (kousik sarathy)
Date: Tue, 8 Sep 2015 12:41:14 +0200
Subject: [FieldTrip] FieldTrip version
In-Reply-To: <55E9B60B.2020803@mcgill.ca>
References: <55E9B60B.2020803@mcgill.ca>
Message-ID: <CAEypuQsOQrxbfaRpB2G9E6WEhrqrM8pN1F0qPoc_Hp-wJfu3uQ@mail.gmail.com>

Hey Francois,

ft_version can be use to track the version of FT. I think it picks up the
function that has been most recently updated. Check 'signature.md5' in the
main FT directory.
Also, each of the output structure has a 'cfg.version' field which carries
the version of that particular function. You could use either which you
need.

--
Regards,
Kousik Sarathy, S


On Fri, Sep 4, 2015 at 5:17 PM, François Tadel <francois.tadel at mcgill.ca>
wrote:

> Hello,
>
> We're currently writing wrappers to call FieldTrip functions from the
> Brainstorm pipeline editor.
> For bookkeeping, we would like to save in the database the version of
> FieldTrip that was used to create the files.
>
> I'm having trouble with the function ft_version:
>     >> [ftver, ftpath] = ft_version
>     Reference to non-existent element of a cell array.
>     Error in ft_version (line 155)
>             rev = rev{1}{1};
>
> The file signature.md5 contains the following text:
>     <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>     <html><head>
>     <title>301 Moved Permanently</title>
>     </head><body>
>     <h1>Moved Permanently</h1>
>     <p>The document has moved <a href="
> http://www.fieldtriptoolbox.org/signature.md5">here</a>.</p>
>     </body></html>
>
> How can I get the version of FieldTrip in a reliable way?
>
> Thanks,
> Francois
>
> --
> François Tadel, MSc
> MEG / McConnell Brain Imaging Center / MNI / McGill University
> 3801 rue University, Montreal, QC H3A2B4, Canada
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150908/bee47ee5/attachment.htm>

From francois.tadel at mcgill.ca  Tue Sep  8 17:09:44 2015
From: francois.tadel at mcgill.ca (Francois Jean Tadel, Mr)
Date: Tue, 8 Sep 2015 15:09:44 +0000
Subject: [FieldTrip] FieldTrip version
Message-ID: <6CBF722E55EFC64BB821ED4EFDADCAFEB1C7460D@exmbx2010-8.campus.MCGILL.CA>

Dear Jorn,

In the last packages from the FTP, the file "signature.md5" contains an HTTP error 301 "Moved Permanently":
ftp://ftp.fcdonders.nl/pub/fieldtrip/fieldtrip-lite-20150907.zip
ftp://ftp.fcdonders.nl/pub/fieldtrip/fieldtrip-20150907.zip

This causes the call to ft_version to fail.

Additional question: is there a reliable way to get the release date of a FieldTrip install?
(when it is not possible to get it from the folder name, for instance if it was unzipped in a folder called simply "fieldtrip")

Cheers,
Francois


From tyler.grummett at flinders.edu.au  Wed Sep  9 10:52:21 2015
From: tyler.grummett at flinders.edu.au (Tyler Grummett)
Date: Wed, 9 Sep 2015 08:52:21 +0000
Subject: [FieldTrip] negative connectivity strength from mvgc
Message-ID: <43C9D76D-9ECA-47F8-9270-349919D6DB33@flinders.edu.au>

Hello fieldtrip experts,

I decided to try multivariate granger causality today, using the steps in the tutorial 'analysis of sensor- and source-level connectivity'. I noticed that I am getting negative connectivity measures in the granger.grangerspctrm. Is this normal? If so, why does this happen?

I apologise if this has been asked before!

Tyler


From markus.gschwind at gmail.com  Wed Sep  9 13:37:18 2015
From: markus.gschwind at gmail.com (Markus Gschwind)
Date: Wed, 9 Sep 2015 13:37:18 +0200
Subject: [FieldTrip] General matlab script for cluster based permutation
	testing?
In-Reply-To: <E1816948-782D-4ED5-AB4A-A9ABBB0790A4@donders.ru.nl>
References: <CABaUQnyuWdD+HygKU5LhN=atc8BAX-AWDq4rzeXea8xvNqA4uA@mail.gmail.com>
 <E1816948-782D-4ED5-AB4A-A9ABBB0790A4@donders.ru.nl>
Message-ID: <CABaUQnzpcti+xioRPEXP7tShrCm2ycRPuwJT3ffSd2EfrBtqjA@mail.gmail.com>

Dear Robert,

Thank you for your lines.

I have now written a matlab script, which uses the bwconncomp.m function
for clustering.

In this context, I have the following question concerning the initial
T-value threshold (which allows binarization and subsequent clustering).

I have bivariate histograms of two conditions, which I want to compare for
differences (N=50). When doing point-wise paried T-tests, my T-values have
a cdf-like shape and go from -8 to +8, meaning, that I have potentially
significant positive and (slightly more) negative differences.

In the paper it says :

(1) For every sample, compare the MEG-signal on the two types of trials
> (...) by means of a t-value (or some other number that quantifies the
> effect at this sample).
> (2) Select all samples whose t-value is larger than some threshold. (This
> threshold may or may not be based on the sampling distribution of the
> t-value under the null hypothesis, but this does not affect the validity of
> the nonparametric test; see further.)
> (3) Cluster the selected samples in connected sets on the basis of
> temporal adjacency.


And then later :

Also, for a two-sided test, the clustering in step 3 is performed
> separately for samples with a positive and a negative t-value.


=> So is it right to choose the threshold for the positive T-values and the
negative T-values separately?

=> Would you then choose the outer 97.5 percentile as the threshold  (i.e.
T>7.2 for the positive and T< -6.3 for the negative values)?

However this is drastically more restrictive than a T-value of >2.0097 in
case of a single two-sided paired T-test with df=49 (N=50), which would be
applied without any correction.

The choice of this initial threshold defines the cluster size!

I would be grateful for any hint! Thank you in advance!
Best,
Markus



2015-09-02 14:14 GMT+02:00 Robert Oostenveld <r.oostenveld at donders.ru.nl>:

> Hi Markus,
>
> That is not something which is not is easily implemented in a single
> script. It requires a whole variety of functionality which is part of the
> FT toolbox (shuffling, clustering, bookeeping), but which cannot easily be
> used if your data is in another format. Perhaps you can reformat your data
> to make it FT-like.
>
> best regards,
> Robert
>
>
>
> On 31 Aug 2015, at 13:56, Markus Gschwind <markus.gschwind at gmail.com>
> wrote:
>
> > Dear all,
> >
> > I wonder if someone could guide me how to use the cluster-based
> permutation testing after (Maris & Oostenvidle, 2007) on non-fieldtrip
> data, for example on simple matrices in matlab.
> >
> > Or is there even a matlab script around?
> >
> > Thanks in advance,
> > Markus
> >
> >
> >
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150909/8354d7f8/attachment.htm>

From jorn at artinis.com  Wed Sep  9 13:58:07 2015
From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=)
Date: Wed, 9 Sep 2015 13:58:07 +0200
Subject: [FieldTrip] negative connectivity strength from mvgc
In-Reply-To: <43C9D76D-9ECA-47F8-9270-349919D6DB33@flinders.edu.au>
References: <43C9D76D-9ECA-47F8-9270-349919D6DB33@flinders.edu.au>
Message-ID: <005f01d0eaf6$caecb7f0$60c627d0$@artinis.com>

Hi Tyler,

as far as I know only the instantaneous causality term might become
negative, not the granger values x->y or y->x themselves. Reasons for this
are a bit dubious as far as I understood (within my limits). In [1], Ding et
al. explained that that the instantaneous causality term can become negative
for certain situations and that it thus might not have a readily
interpretable physical meaning. It could have something to do with SNR or
with real, third region influences. But this is speculative and in fact I
have no idea. I hope this helps, or at least provides a reference to read up
on this ;)

Best,
Jörn


[1] Ding, M., Chen, Y., and Bressler, S. L. (2006). Granger Causality: Basic
Theory and Application to Neuroscience. In Handbook of Time Series Analysis,
B. Schelter, M. Winterhalder, and J. Timmer, eds. (Wiley-VCH Verlag GmbH &
Co. KGaA), pp. 437460. Available at:
http://onlinelibrary.wiley.com/doi/10.1002/9783527609970.ch17/summary
[Accessed April 8, 2014].


--

Jörn M. Horschig, PhD, Software Engineer
Artinis Medical Systems  |  +31 481 350 980 

> -----Original Message-----
> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-
> bounces at science.ru.nl] On Behalf Of Tyler Grummett
> Sent: Wednesday, September 9, 2015 10:52 AM
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: [FieldTrip] negative connectivity strength from mvgc
> 
> Hello fieldtrip experts,
> 
> I decided to try multivariate granger causality today, using the steps in
the
> tutorial 'analysis of sensor- and source-level connectivity'. I noticed
that I am
> getting negative connectivity measures in the granger.grangerspctrm. Is
this
> normal? If so, why does this happen?
> 
> I apologise if this has been asked before!
> 
> Tyler
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




From tyler.grummett at flinders.edu.au  Wed Sep  9 14:31:38 2015
From: tyler.grummett at flinders.edu.au (Tyler Grummett)
Date: Wed, 9 Sep 2015 12:31:38 +0000
Subject: [FieldTrip] negative connectivity strength from mvgc
In-Reply-To: <005f01d0eaf6$caecb7f0$60c627d0$@artinis.com>
References: <43C9D76D-9ECA-47F8-9270-349919D6DB33@flinders.edu.au>,
 <005f01d0eaf6$caecb7f0$60c627d0$@artinis.com>
Message-ID: <B582B814-6CA3-41BC-BF76-2B5F56853717@flinders.edu.au>

Hey Jorn,

Thanks for the prompt reply. Would it matter that the segments of data going into the multivariate analysis are non-time locked? They are just segments of data from a free running task (so to speak).

I'm worried because the adjacency matrices (viewed using imagesc) don't look right.

Tyler



> On 9 Sep 2015, at 9:30 pm, Jörn M. Horschig <jorn at artinis.com> wrote:
> 
> Hi Tyler,
> 
> as far as I know only the instantaneous causality term might become
> negative, not the granger values x->y or y->x themselves. Reasons for this
> are a bit dubious as far as I understood (within my limits). In [1], Ding et
> al. explained that that the instantaneous causality term can become negative
> for "certain situations" and that it thus might not have a "readily
> interpretable physical meaning". It could have something to do with SNR or
> with real, third region influences. But this is speculative and in fact I
> have no idea. I hope this helps, or at least provides a reference to read up
> on this ;)
> 
> Best,
> Jörn
> 
> 
> [1] Ding, M., Chen, Y., and Bressler, S. L. (2006). Granger Causality: Basic
> Theory and Application to Neuroscience. In Handbook of Time Series Analysis,
> B. Schelter, M. Winterhalder, and J. Timmer, eds. (Wiley-VCH Verlag GmbH &
> Co. KGaA), pp. 437-460. Available at:
> http://onlinelibrary.wiley.com/doi/10.1002/9783527609970.ch17/summary
> [Accessed April 8, 2014].
> 
> 
> --
> 
> Jörn M. Horschig, PhD, Software Engineer
> Artinis Medical Systems  |  +31 481 350 980 
> 
>> -----Original Message-----
>> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-
>> bounces at science.ru.nl] On Behalf Of Tyler Grummett
>> Sent: Wednesday, September 9, 2015 10:52 AM
>> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
>> Subject: [FieldTrip] negative connectivity strength from mvgc
>> 
>> Hello fieldtrip experts,
>> 
>> I decided to try multivariate granger causality today, using the steps in
> the
>> tutorial 'analysis of sensor- and source-level connectivity'. I noticed
> that I am
>> getting negative connectivity measures in the granger.grangerspctrm. Is
> this
>> normal? If so, why does this happen?
>> 
>> I apologise if this has been asked before!
>> 
>> Tyler
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



From r.oostenveld at donders.ru.nl  Wed Sep  9 14:53:21 2015
From: r.oostenveld at donders.ru.nl (Robert Oostenveld)
Date: Wed, 9 Sep 2015 14:53:21 +0200
Subject: [FieldTrip] General matlab script for cluster based permutation
	testing?
In-Reply-To: <CABaUQnzpcti+xioRPEXP7tShrCm2ycRPuwJT3ffSd2EfrBtqjA@mail.gmail.com>
References: <CABaUQnyuWdD+HygKU5LhN=atc8BAX-AWDq4rzeXea8xvNqA4uA@mail.gmail.com>
 <E1816948-782D-4ED5-AB4A-A9ABBB0790A4@donders.ru.nl>
 <CABaUQnzpcti+xioRPEXP7tShrCm2ycRPuwJT3ffSd2EfrBtqjA@mail.gmail.com>
Message-ID: <2ADC5D9F-2F0F-428D-BDD7-C7A2CBF9FEFB@donders.ru.nl>

Hi Markus

On 09 Sep 2015, at 13:37, Markus Gschwind <markus.gschwind at gmail.com> wrote:

> => So is it right to choose the threshold for the positive T-values and the negative T-values separately?

It is allowed, but not required. If you know that your massinve univariate statistical values form a symetrical distribution, you could also have a single threshold (and use that plus/minus).

But is is good that you raise this point. In the FieldTrip implementation we are in general performing seperate tests for the clusters that exceed the positive and the negative threshold. I.e. we make separate histograms of cluster mass, and separately decide the probability of observing the clusters in the data (given H0).

See http://www.fieldtriptoolbox.org/faq/why_should_i_use_the_cfg.correcttail_option_when_using_statistics_montecarlo

If you choose to use a single threshold, and assume symmetry, you can also concatenate the positive and negative cluster mass histograms (after correcting for the sign) and do a single test (again correcting for sign in the observed clusters). This basically boils down to using abs(t) as the test statistic and only doing a single sided test.

> => Would you then choose the outer 97.5 percentile as the threshold  (i.e. T>7.2 for the positive and T< -6.3 for the negative values)? 

The choice of the threshold for clustering does not influence the validity of the statistical test. It will affect the sensitivity of the test. Choosing it too small or too large will decrease sensitivity. But note that this is not a parameter you are allowed to play with, i.e. trying out many values for the threshold, and then reporting only the outcomes that you like. This would constitute multiple testing, and you would have to (Bonferroni) correct for it. 

> However this is drastically more restrictive than a T-value of >2.0097 in case of a single two-sided paired T-test with df=49 (N=50), which would be applied without any correction.
> 
> The choice of this initial threshold defines the cluster size!

Yes. There are many more choices in the analysis that will determine the cluster size, such as temporal filtering, or spectral smoothing. As long as the choice is consistently applied assuming that H0 holds, it does not affect the validity of the test. But it does affect the sensitivity (as previously mentioned).

best
Robert



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

From jia.wu at yale.edu  Wed Sep  9 15:14:20 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Wed, 9 Sep 2015 13:14:20 +0000
Subject: [FieldTrip] beamformer on EEG data
In-Reply-To: <CAK9dbJaLEwa6Z45_s9VjGjuE76YxsW41KXv_8W-yusr83Yu3Qw@mail.gmail.com>
References: <AA21F9F31911364596BE68CA1AAD8DA466E1DE72@x10-mbx13.yu.yale.edu>
 <AA21F9F31911364596BE68CA1AAD8DA466E1EF7E@x10-mbx13.yu.yale.edu>
 <CAK9dbJYV2zB-=hZeWVSWzXr_X1x0JCU=FFaJHyMe94RMKwNt7Q@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F25F@x10-mbx13.yu.yale.edu>
 <CAK9dbJbzLr7X8101EGu0031yoQ2JdrsUidNhLGuat5tWRbQKGg@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F330@x10-mbx13.yu.yale.edu>,
 <CAK9dbJaLEwa6Z45_s9VjGjuE76YxsW41KXv_8W-yusr83Yu3Qw@mail.gmail.com>
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E1F4A2@x10-mbx13.yu.yale.edu>

Azeez,

I tried volumewrite and it generated the same thing as sourcewrite.

I'm going to assume that the calculation with aligned positions was correct and proceed. Thank you for your input.

best,
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Azeez Adebimpe [azeez.adebimpe5 at gmail.com]
Sent: Tuesday, September 08, 2015 2:53 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] beamformer on EEG data

Hi Jia,

Can you ft_volumewrite instead of ft_sourcewrite  after interpolation

Azeez

On Sun, Sep 6, 2015 at 4:10 AM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
Azeez
Thanks for getting back to me. I used ft_sourceplot and it always looked fine no matter what I put in.  When I used unaligned net position and headmodel there is no warning while running scripts regarding it. I'm just really concerned that something went wrong and the signal I was mapping was from a completely wrong part of the brain.
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Azeez Adebimpe [azeez.adebimpe5 at gmail.com<mailto:azeez.adebimpe5 at gmail.com>]
Sent: Friday, September 04, 2015 11:36 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] beamformer on EEG data

Hi Jia,

There  may be problem in viewing if there is no issues or warning in headmodel construction.
Can you use view in fieldtrip first  with ft_sourceplot after  or before interpolation to compare  with micron?

Azeez



On Fri, Sep 4, 2015 at 5:17 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
Azeez,

Thanks for getting back to me. Yes I used the same MRI. But since you asked, I went back and double checked all the steps and put together the code as below. I used MRIcro to looked at the source output. The output still doesn't look quite like a brain: http://imgur.com/Kn3sbgm.<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_Kn3sbgm.&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=vgnpwQD5TlKRzVO4m-lQwR08lEmpPNrKkeKHx27rmhI&s=2DWDnT6nVX0DpGqntWy_5IUNtt5OFEJQZloL_ldDxec&e=>

Code is here:
https://github.com/sindhri/try_fieldtrip/blob/master/run_data_sample_sent.m<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sindhri_try-5Ffieldtrip_blob_master_run-5Fdata-5Fsample-5Fsent.m&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=vgnpwQD5TlKRzVO4m-lQwR08lEmpPNrKkeKHx27rmhI&s=lFRgT-Sr8abQl8cd0_eruwtbpdP_3srp7OiXMUZs1KE&e=>

sample data here: (sorry the link expires in a week)
download password:code
https://files.yale.edu/public_download?shareId=40d6f4c574599585eecaef773c7b927e

Thank you very much for your help!

best,
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Azeez Adebimpe [azeez.adebimpe5 at gmail.com<mailto:azeez.adebimpe5 at gmail.com>]
Sent: Tuesday, September 01, 2015 5:28 PM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] beamformer on EEG data

Hi Jia,

Do you interpolate on the same MRI you used for  construct headmodel?
Can you post your matlab code?

Azeez

On Tue, Sep 1, 2015 at 11:20 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
Hi,

Here is the most problematic part of my analysis.

When I did not align electrode positions with headmodel, I was able to get interpolated source signal that resembled a brain.
http://imgur.com/bZkGqsk<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_bZkGqsk&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=Pq7HZiQsFtOT9Nl4SPperxlyaBByDsKFHyM5S32q0DE&e=>

However if I managed to align electrode positions with headmodel, (then build the correct leadfield), the interpolated source did not resemble a brain.
http://imgur.com/XQMyiQy<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_XQMyiQy&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=2nXDThp6Y65bF1-enB75g9fYxxFO6z3poQIyctjGq-Y&e=>

Anybody has a clue what was going on?

best,
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Wu, Jia [jia.wu at yale.edu<mailto:jia.wu at yale.edu>]
Sent: Monday, August 31, 2015 4:33 PM
To: FieldTrip discussion list
Subject: [FieldTrip] beamformer on EEG data

Hi,
I'm new to the community and fieldtrip. I'm trying to use beamformer to do oscillatory source localization on some EEG data.

I thought I stumbled upon some tutorial specific on this top on the fieldtrip wiki, but I couldn't find it any more. Most source localization materials seem to be for MEG data. And I've been confused about the steps to build a correct headmodel, sourcemodel, leadfield based on only EEG information.

Anybody has a quick link to the tutorial? If such tutorial doesn't exist I will email the group about my specific questions.

best,
-jia

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=8aDZNzQKqFKPrBsVo7s9Bcw2_W3DVOh8Z_01ATDCjso&s=SDcXU6EPMuaMwjujbNEU9iuxnVYcl7-xguabqlYxQSE&e=>


_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=vgnpwQD5TlKRzVO4m-lQwR08lEmpPNrKkeKHx27rmhI&s=icp3IlgY7tb8LtTMtfPwmBAMLtKnFkwb6w1FX-oJXlA&e=>


_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=FgXhUVL30li6Lq8xSJKbS_zBk14zkPnceAJCERJLEtk&s=VvTEKBT9Iqu1oqiSilO9co1G6FQha07VBcuDWTffcLQ&e=>

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

From r.oostenveld at donders.ru.nl  Wed Sep  9 17:51:14 2015
From: r.oostenveld at donders.ru.nl (Robert Oostenveld)
Date: Wed, 9 Sep 2015 17:51:14 +0200
Subject: [FieldTrip] FieldTrip version
In-Reply-To: <6CBF722E55EFC64BB821ED4EFDADCAFEB1C7460D@exmbx2010-8.campus.MCGILL.CA>
References: <6CBF722E55EFC64BB821ED4EFDADCAFEB1C7460D@exmbx2010-8.campus.MCGILL.CA>
Message-ID: <79AF0CAD-220A-443E-B0B1-67BF61272DF8@donders.ru.nl>

Hi Francois,

Bummer. I recently deleted that signature file from out server, thinking that it was not used any more. However, I don’t think that the md5 hashes in that file were updated properly any more. Also, the planned functionality with that file (i.e. the user doing "ft_version update” in MATLAB) was never made to full completion.

I know that ft_version works fine in case you have a local copy that is checked out through SVN (as Jorn demonstrated). But I don’t think that the versioning is currently working for a version that you download from the ftp server. 

I will look at the code of ft_version and see whether I can add a small “version” file to the content of the zip file and have ft_version check that. Regarding version naming, the release numbers provides a unique identifier, the date not so much (as there can be multiple commits on a day). But svn info also gives the date, so I could include that in the output. 

Let’s follow this up on http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=1449

best
Robert
 







On 08 Sep 2015, at 17:09, Francois Jean Tadel, Mr <francois.tadel at mcgill.ca> wrote:

> Dear Jorn,
> 
> In the last packages from the FTP, the file "signature.md5" contains an HTTP error 301 "Moved Permanently":
> ftp://ftp.fcdonders.nl/pub/fieldtrip/fieldtrip-lite-20150907.zip
> ftp://ftp.fcdonders.nl/pub/fieldtrip/fieldtrip-20150907.zip
> 
> This causes the call to ft_version to fail.
> 
> Additional question: is there a reliable way to get the release date of a FieldTrip install?
> (when it is not possible to get it from the folder name, for instance if it was unzipped in a folder called simply "fieldtrip")
> 
> Cheers,
> Francois
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




From mehmetakifozcoban at gmail.com  Wed Sep  9 21:11:25 2015
From: mehmetakifozcoban at gmail.com (=?UTF-8?B?TWVobWV0IEFraWYgw5Z6w6dvYmFu?=)
Date: Wed, 9 Sep 2015 22:11:25 +0300
Subject: [FieldTrip] negative connectivity strength from mvgc
In-Reply-To: <43C9D76D-9ECA-47F8-9270-349919D6DB33@flinders.edu.au>
References: <43C9D76D-9ECA-47F8-9270-349919D6DB33@flinders.edu.au>
Message-ID: <CANdEZ2iZc0xsNdZaahzTi_yVzgkk0g__Wikkta=QVXgo_vcmbg@mail.gmail.com>

Dear Tyler could you send më your  matlab script för Compute granger
causality  please
9 Eyl 2015 12:34 tarihinde "Tyler Grummett" <tyler.grummett at flinders.edu.au>
yazdı:

> Hello fieldtrip experts,
>
> I decided to try multivariate granger causality today, using the steps in
> the tutorial 'analysis of sensor- and source-level connectivity'. I noticed
> that I am getting negative connectivity measures in the
> granger.grangerspctrm. Is this normal? If so, why does this happen?
>
> I apologise if this has been asked before!
>
> Tyler
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150909/429e5794/attachment.htm>

From daria.laptinskaya at googlemail.com  Thu Sep 10 10:38:56 2015
From: daria.laptinskaya at googlemail.com (Daria Laptinskaya)
Date: Thu, 10 Sep 2015 10:38:56 +0200
Subject: [FieldTrip] Problem with ft_megrealign
Message-ID: <CADcxnnOuyYNG_X=zcZoEGH0yPnb=mqpNgEK_C0UvyYaJQYvT0A@mail.gmail.com>

Dear all,

I would like to apply the ft_megrealign function to MEG data.

First I tried this:

    cfg             = [];

    cfg.vol.r       = 12;

    cfg.vol.o       = [0, 0, 4];

    cfg.template    = allsens;

    cfg.channel     = {'MEG'};

    cfg.inwardshift =  1;

    cfg.headshape   = 'hs_file';



new_data = ft_megrealign(cfg, old_data);



Then I got the following error message:

At compilation, "template" was determined to be a variable and this
variable is
uninitialized. "template" is also a function name and previous versions of
MATLAB would
have called the function. However, MATLAB 7 forbids the use of the same
name in the same
context as both a function and a variable.



I thought that renaming the variable “template” would solve the problem and
did the following within the original function (replaced the
template-variable with the Ntp_avg variable):



Ntp_avg = length(cfg.template);

for i=1:Ntp_avg

  if ischar(cfg.template{i}),

    fprintf('reading template sensor position from %s\n', cfg.template{i});

    tp_avg(i) = ft_read_sens(cfg.template{i});

  elseif isstruct(cfg.template{i}) && isfield(cfg.template{i}, 'coilpos')
&& isfield(cfg.template{i}, 'coilori') && isfield(cfg.template{i}, 'tra'),

    tp_avg(i) = cfg.template{i};

  end

end



No I get an error message, that “the variable tp_avg is not defined”.

Do I forget something? Or do anyone have an other solution for the problem?



I would appreciate any help / ideas!



Thanks in advance!



Best,

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

From jorn at artinis.com  Thu Sep 10 10:52:46 2015
From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=)
Date: Thu, 10 Sep 2015 10:52:46 +0200
Subject: [FieldTrip] Problem with ft_megrealign
In-Reply-To: <CADcxnnOuyYNG_X=zcZoEGH0yPnb=mqpNgEK_C0UvyYaJQYvT0A@mail.gmail.com>
References: <CADcxnnOuyYNG_X=zcZoEGH0yPnb=mqpNgEK_C0UvyYaJQYvT0A@mail.gmail.com>
Message-ID: <007801d0eba6$10816b80$31844280$@artinis.com>

Dear Daria,

 

try initializing tp_avg just before the for-loop, e.g. by set tp_avg = []

 

The error message you got means that you have a function called template somewhere in your path. In the command line, you can type 

>> which template

to find out where function is located. Afaik it’s not a FieldTrip function.  Anyway, to fix this, the template variable should have been initialized in the same vein as I described above. I’ll quickly fix this so that this does not happen anymore in the new version (from tomorrow onwards). 

This means, also for you the fix would have been just to initialize the template variable rather than renaming the variable, but your solution also works fine after initializing the variable ;)

 

Best,

Jörn

 

 

 

--

 

Jörn M. Horschig, PhD, Software Engineer

 <http://www.artinis.com/> Artinis Medical Systems  |  +31 481 350 980 

 

From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Daria Laptinskaya
Sent: Thursday, September 10, 2015 10:39 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Problem with ft_megrealign

 

Dear all,

I would like to apply the ft_megrealign function to MEG data.

First I tried this: 

    cfg             = [];

    cfg.vol.r       = 12;

    cfg.vol.o       = [0, 0, 4];

    cfg.template    = allsens;

    cfg.channel     = {'MEG'};

    cfg.inwardshift =  1;

    cfg.headshape   = 'hs_file';

 

new_data = ft_megrealign(cfg, old_data);

 

Then I got the following error message:

At compilation, "template" was determined to be a variable and this variable is
uninitialized. "template" is also a function name and previous versions of MATLAB would
have called the function. However, MATLAB 7 forbids the use of the same name in the same
context as both a function and a variable.

 

I thought that renaming the variable “template” would solve the problem and did the following within the original function (replaced the template-variable with the Ntp_avg variable):

 

Ntp_avg = length(cfg.template);

for i=1:Ntp_avg

  if ischar(cfg.template{i}),

    fprintf('reading template sensor position from %s\n', cfg.template{i});

    tp_avg(i) = ft_read_sens(cfg.template{i});

  elseif isstruct(cfg.template{i}) && isfield(cfg.template{i}, 'coilpos') && isfield(cfg.template{i}, 'coilori') && isfield(cfg.template{i}, 'tra'),

    tp_avg(i) = cfg.template{i};

  end

end

 

No I get an error message, that “the variable tp_avg is not defined”.

Do I forget something? Or do anyone have an other solution for the problem?

 

I would appreciate any help / ideas!

 

Thanks in advance!

 

Best,

Daria     

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

From russgport at gmail.com  Thu Sep 10 18:31:28 2015
From: russgport at gmail.com (russ port)
Date: Thu, 10 Sep 2015 12:31:28 -0400
Subject: [FieldTrip] unit gain for Fieldtrip's LCMV beam former - unit for
	LCMV derived timecourse
Message-ID: <832F3F5A-2D98-4CA5-AD36-5AB437E59A6B@gmail.com>

Hi All,

Sorry to bother you, but I have a question that I would just like to bounce of the list (to make sure I understand what I’m talking about). The fieldtrip version of LCMV beamforming use a unit-gain (AKA unit length) normalization for the analysis. As such (according to http://cheynelab.utoronto.ca/httpdoc/Introduction_to_beamforming_part2.pdf <http://cheynelab.utoronto.ca/httpdoc/Introduction_to_beamforming_part2.pdf>), the output unit of the beamformer derived time course (shown on previous discussion list post as making sensor weights (involving the lead fields for the dipole position AND covariance matrix) and multiplying the data per trial by the result), would be IF we had not used unit gain, A-m, but since we add the normalization, the unit of the output is arbitrary units. As such, when I plot an example time course of the data, there is no unit for the y axis.

Sorry for checking this, but I figure its safer to ask, and hopefully someone else is also wondering the same thing.

Best ,
Russ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150910/2b985f36/attachment.htm>

From marc.lalancette at sickkids.ca  Fri Sep 11 18:40:20 2015
From: marc.lalancette at sickkids.ca (Marc Lalancette)
Date: Fri, 11 Sep 2015 16:40:20 +0000
Subject: [FieldTrip] unit gain for Fieldtrip's LCMV beamformer - unit
Message-ID: <2A2B6A5B8C4C174CBCCE0B45E548DEB22A0D8A9B@SKMBXX01.sickkids.ca>

Hi Russ,

There are lots of options in Fieldtrip, in particular various normalization options.  First the theory: careful not to confuse "unit gain" and "unit noise-gain".  I suppose these names may be defined differently in different places, but I'll use them as defined by Sekihara (great book for understanding beamforming).  Thus the latter has unit length weights, not the former and a scalar beamformer with unit gain would have Am units.  However, see a previous thread about Fieldtrip's leadfield units: http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008438.html which would possibly also affect unit gain beamformer results.  I would double check if using that to confirm units.  For vector beamforming, power would be returned so units should be (Am)^2.  If the power is normalized by the estimated projected noise power, we get an estimate of output SNR (pseudo-Z^2, no units, sometimes called neural activity index, though not same formula as the original NAI by Van Veen).  This is often how unit noise-gain is used, by also dividing the result by an estimate of sensor noise power (assumed uniform across sensors).

That being said, I think Fieldtrip's LCMV by default will use a 2-d vector beamformer (2 "tangential" source orientations, those corresponding to the 2 largest eigenvalue of the leadfield eigendecomposition).  It does not however use unit noise-gain as defined by Sekihara (which is good by the way because that solution is not rotationally invariant - I had a poster on that last Biomag).  Instead it does a slightly different normalization dividing the summed power by the summed projected noise power (summed over the 2 orientations).  That is a rotationally invariant solution but may not be as sharp as other options.  There would be more to say about these different normalization options.

But to answer your question, yes in some cases there would be no units for the beamformer time course, though of course even then the quantity should still be properly identified.  My personal preference however is to get time courses in physical units (Am or squared for power).  I find it makes interpretation easier and comparisons more meaningful than comparing say SNR between groups.

Cheers,

Marc Lalancette
Lab Research Project Manager, Research MEG lab
Department of Diagnostic Imaging, Program in Neurosciences and Mental Health
The Hospital for Sick Children, 555 University Avenue, Room S742, Toronto, ON, M5G 1X8
416-813-7654 x201535




-----Original Message-----
From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of fieldtrip-request at science.ru.nl
Sent: September 11, 2015 06:00
To: fieldtrip at science.ru.nl
Subject: fieldtrip Digest, Vol 58, Issue 10

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

To subscribe or unsubscribe via the World Wide Web, visit
        http://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. unit gain for Fieldtrip's LCMV beam former - unit for     LCMV
      derived timecourse (russ port)


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

Message: 1
Date: Thu, 10 Sep 2015 12:31:28 -0400
From: russ port <russgport at gmail.com>
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] unit gain for Fieldtrip's LCMV beam former - unit
        for     LCMV derived timecourse
Message-ID: <832F3F5A-2D98-4CA5-AD36-5AB437E59A6B at gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi All,

Sorry to bother you, but I have a question that I would just like to bounce of the list (to make sure I understand what I?m talking about). The fieldtrip version of LCMV beamforming use a unit-gain (AKA unit length) normalization for the analysis. As such (according to http://cheynelab.utoronto.ca/httpdoc/Introduction_to_beamforming_part2.pdf <http://cheynelab.utoronto.ca/httpdoc/Introduction_to_beamforming_part2.pdf>), the output unit of the beamformer derived time course (shown on previous discussion list post as making sensor weights (involving the lead fields for the dipole position AND covariance matrix) and multiplying the data per trial by the result), would be IF we had not used unit gain, A-m, but since we add the normalization, the unit of the output is arbitrary units. As such, when I plot an example time course of the data, there is no unit for the y axis.

Sorry for checking this, but I figure its safer to ask, and hopefully someone else is also wondering the same thing.

Best ,
Russ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150910/2b985f36/attachment-0001.html>

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

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

End of fieldtrip Digest, Vol 58, Issue 10
*****************************************

________________________________

This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.



From g.dipisa at gmail.com  Sat Sep 12 16:52:33 2015
From: g.dipisa at gmail.com (Grazia Di Pisa)
Date: Sat, 12 Sep 2015 16:52:33 +0200
Subject: [FieldTrip] ICA - not applying the backprojection matrix to the
	sensor description - Why?
Message-ID: <BF916772-206C-438F-8AAA-A3D7E6916499@gmail.com>

Dear all,

I’m currently trying to do ICA to remove eye blinks from my EEG data.
I've basically used the script on the tutorial, and even thou it says ‘removing 4 components’ then it gives me 'not applying the backprojection matrix to the sensor description’.

	<<	detected 0 visual
                removing 4 components
		keeping 57 components
		processing trials
		processing trial 166 from 166

		not applying the backprojection matrix to the sensor description
		the call to "ft_rejectcomponent" took 1 seconds and required the additional allocation of an estimated 245 MB	>> 

Shouldn’t it be 'applying the backprojection matrix to the sensor description’ in order to be effective?
If someone could give some explanation, it would be very much appreciated!

This is the script I used:

    cfg        = [];
    cfg.method = 'runica'; 
    cfg.channel = 'EEG'; 
    
    comp = ft_componentanalysis(cfg, data);

%% Identify the artifacts:

    figure
    cfg = [];
    cfg.component = 1:30;       
    cfg.layout    = 'biosemi64.lay'; 
    cfg.comment   = 'no';

    ft_topoplotIC(cfg, comp)

%% Further inspection of the time course of the components:

    cfg = [];
    cfg.layout = 'biosemi64.lay'; 
    cfg.viewmode = 'component';

    ft_databrowser(cfg, comp);                                             

 %% Remove components and backprojecting:
  
    cfg = []; 
    cfg.component = [2 53 54 61]; % to be removed component(s)
    cfg.demean   = 'no';
    cfg.updatesens = 'yes';

    data.ica.analysed = ft_rejectcomponent(cfg, comp);


best,
~ grazia




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

From helen.wieffering at gmail.com  Mon Sep 14 22:46:41 2015
From: helen.wieffering at gmail.com (Helen Wieffering)
Date: Mon, 14 Sep 2015 16:46:41 -0400
Subject: [FieldTrip] Aligning electrodes to template head model
Message-ID: <CAPayXFwPgwYcafEPnyT404HR52QtuLjMWS5yJ=CJM0U03gYMdQ@mail.gmail.com>

Hello all,

I have a quick question on aligning electrodes to the standard_bem
headmodel, which I downloaded from the FT server.

Namely, are the standard_mri and the standard_bem in the same coordinate
system? I assumed this would be so, since one was developed from the other.
But when I try to align my electrodes to the standard_bem volume using
fiducial positions from the standard_mri, I get very strange results:
(image below and attached)

[image: Inline image 1]

I'm using a GSN HydroCel 128 Cap, and my elec structure contains the
fiducial positions relative to the electrodes.
I've been following the tutorial at
http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg and would like to
follow the steps under 'Automatic Alignment', but as I said: pulling the
fiducial positions from the standard_mri seems to not work with the
tutorial steps.

Any help is appreciated - thanks in advance!

Helen Wieffering
Bowdoin College
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150914/dec30de2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unaligned.jpg
Type: image/jpeg
Size: 13372 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150914/dec30de2/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unaligned.jpg
Type: image/jpeg
Size: 13372 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150914/dec30de2/attachment-0001.jpg>

From jia.wu at yale.edu  Tue Sep 15 05:00:33 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Tue, 15 Sep 2015 03:00:33 +0000
Subject: [FieldTrip] Aligning electrodes to template head model
In-Reply-To: <CAPayXFwPgwYcafEPnyT404HR52QtuLjMWS5yJ=CJM0U03gYMdQ@mail.gmail.com>
References: <CAPayXFwPgwYcafEPnyT404HR52QtuLjMWS5yJ=CJM0U03gYMdQ@mail.gmail.com>
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E1F914@x10-mbx13.yu.yale.edu>

Helen,

What a coincident. I'm also working on source analysis on EEG data using GSN HydroCel 128. I had a post a couple weeks ago about later steps. But I did get the alignment to work. The picture you posted looked like the status before the alignment. So i suspect that alignment did not happen.

I'm not sure whether you have noticed it, but the fiducial positions in elec location file were called 'FidNz', 'FidT9', 'FidT10', instead of 'Nz','LPA','RPA' as in the tutorial. So they need to be changed. Then the alignment should work.

best,
-jia

________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helen Wieffering [helen.wieffering at gmail.com]
Sent: Monday, September 14, 2015 4:46 PM
To: FieldTrip discussion list
Subject: [FieldTrip] Aligning electrodes to template head model

Hello all,

I have a quick question on aligning electrodes to the standard_bem headmodel, which I downloaded from the FT server.

Namely, are the standard_mri and the standard_bem in the same coordinate system? I assumed this would be so, since one was developed from the other. But when I try to align my electrodes to the standard_bem volume using fiducial positions from the standard_mri, I get very strange results: (image below and attached)

[Inline image 1]

I'm using a GSN HydroCel 128 Cap, and my elec structure contains the fiducial positions relative to the electrodes.
I've been following the tutorial at http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_tutorial_headmodel-5Feeg&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=wNRiA8CLR4Y1ZrEaTkTaIoVaUczL5TYuWIx6FyQDphg&s=LjU77qpw8I7LnSHIEQrNIB0R0YLrutfAEtjjOMjBys0&e=> and would like to follow the steps under 'Automatic Alignment', but as I said: pulling the fiducial positions from the standard_mri seems to not work with the tutorial steps.

Any help is appreciated - thanks in advance!

Helen Wieffering
Bowdoin College
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/fdf60662/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unaligned.jpg
Type: image/jpeg
Size: 13372 bytes
Desc: unaligned.jpg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/fdf60662/attachment.jpg>

From iris.steinmann at med.uni-goettingen.de  Tue Sep 15 10:47:53 2015
From: iris.steinmann at med.uni-goettingen.de (Steinmann, Iris)
Date: Tue, 15 Sep 2015 08:47:53 +0000
Subject: [FieldTrip] using ICA to remove ECG artifacts - but all components
 seems to be correlated with the ecg signal
Message-ID: <A0898A0619E8724487198481181011B492E0@umg-exc-1.ads.local.med.uni-goettingen.de>

Hi at all,
I'm using fieldtrip to analyze my EEG data recorded with a Brainamp
MRplus system and an easycap with 31 eeg-channels plus one separate ecg electrode.

To get rid of the ecg based artifacts in my EEG data I followed the
fieldtrip tutorial 'Use independent component analysis (ICA) to remove
ECG artifacts'. (I followed step by step and posted the code down below)
The problem is, that I dont't get a clear separation of one or two
components which reflect the ecg artifact (like in the example of the tutorial).
All my components show a timelocked correlation with the separated ecg signal... (attached some .jpgs)
So, I wondering if I have done something wrong ...

Would be great if someone could help me to find a solution for this.
Thanks!

Iris



% ======================= code starts here ===============================%
% calculate ICA component for the trialed, downsampled and basic corrected (jumps, muscles) eeg data
% (called basiccorr_data.mat)
cfg4ica = [];
cfg4ica.inputfile = 'C:\mydirectory\basiccorr_data.mat';
cfg4ica.method = 'runica';
cfg4ica.channel = 'eeg';
cfg4ica.trials = 'all';
cfg4ica.numcomponent = 15;
cfg4ica.demean = 'yes';
cfg4ica.updatesens = 'yes';
comp_basiccorr_data = ft_componentanalysis(cfg4ica);
% plot the components (maybe a little overdressed ...)
cfg4plot = [];
cfg4plot.component = 1 : 15;
cfg4plot.layout = 'myEasyCap32MR.lay';
cfg4plot.viewmode = 'component';
cfg4plot.zlim = [];
cfg4plot.marker = 'on';
cfg4plot.markersymbol = 'o';
cfg4plot.markercolor = [0 0 0];
cfg4plot.markersize = 2;
cfg4plot.markerfontsize = 8;
cfg4plot.highlight = [];
cfg4plot.highlightchannel = [];
cfg4plot.highlightsymbol = 'o';
cfg4plot.highlightcolor = [0 0 0];
cfg4plot.highlightsize = 6;
cfg4plot.highlightfontsize = 8;
cfg4plot.colorbar = 'no';
cfg4plot.interplimits = 'head';
cfg4plot.interpolation = 'v4';
cfg4plot.style = 'both';
cfg4plot.gridscale = 67;
cfg4plot.shading = 'flat';
cfg4plot.comment = 'no';
cfg4plot.commentpos = 'leftbottom';
cfg4plot.title = 'auto';
figure
ft_topoplotIC(cfg4plot, comp_basiccorr_data);

% ---------------------------------------------------------------- %
% find the artifacts in the continuous raw data
cfg4find_ecg = [];
cfg4find_ecg.dataset = 'C:\mydirectory\EEGdata_2000023.eeg';
a = load('C:\mydirectory\t_data'); % load the trialed data to get the .trl information
cfg4find_ecg.trl = a.data.cfg.trl;
cfg4find_ecg.continuous = 'yes';
cfg4find_ecg.artfctdef.ecg.pretim = 0.25;
cfg4find_ecg.artfctdef.ecg.psttim = 0.50-1/512;
cfg4find_ecg.channel = {'ECG'};
cfg4find_ecg.artfctdef.ecg.inspect = {'ECG'};
cfg4find_ecg.artfctdef.ecg.cutoff = 0.2;
[cfg_artifact, ecg_artifact] = ft_artifact_ecg(cfg4find_ecg);
% cut the original data around the ecg-artifact
cfg4cut_ecg = [];
cfg4cut_ecg.dataset = 'C:\mydirectory\EEGdata_2000023.eeg';
cfg4cut_ecg.continuous = 'yes';
cfg4cut_ecg.padding = 0.5;
cfg4cut_ecg.dftfilter = 'yes';
cfg4cut_ecg.demean = 'yes';
cfg4cut_ecg.trl = [ecg_artifact zeros(size(ecg_artifact,1),1)];
cfg4cut_ecg.channel = {'eeg'};
data_ecg = ft_preprocessing(cfg4cut_ecg);
cfg4cut_ecg.channel = {'ecg'};
ecg = ft_preprocessing(cfg4cut_ecg);

% resample to speed up
cfg4resample = [];
cfg4resample.resamplefs = 512;
cfg4resample.detrend = 'no';
data_ecg = ft_resampledata(cfg4resample, data_ecg);
ecg = ft_resampledata(cfg4resample, ecg);
% decompose the ECG-locked data segments into components, using the previously found (un)mixing matrix
cfg4ica_ecg = [];
cfg4ica_ecg.unmixing = comp_basiccorr_data.unmixing;
cfg4ica_ecg.topolabel = comp_basiccorr_data.topolabel;

comp_ecg = ft_componentanalysis(cfg4ica_ecg, data_ecg);
% plot the components
figure
ft_topoplotIC(cfg4plot, comp_ecg);

% ---------------------------------------------------------------- %
% append the ecg channel to the data structure;
comp_ecg = ft_appenddata([], ecg, comp_ecg);
% average the components timelocked to the QRS-complex
cfg           = [];
timelock      = ft_timelockanalysis(cfg, comp_ecg);
figure
subplot(2,1,1); plot(timelock.time, timelock.avg(1,:))
subplot(2,1,2); plot(timelock.time, timelock.avg(2:end,:))
title('ecg');
figure
subplot(2,1,1); plot(timelock.time, timelock.avg(1,:))
subplot(2,1,2); imagesc(timelock.avg(2:end,:));
title('ecg');
% ======================= code ends here =================================%


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/990d57ee/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecg-and-components.jpg
Type: image/jpeg
Size: 34190 bytes
Desc: ecg-and-components.jpg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/990d57ee/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecg-and-spectral-components.jpg
Type: image/jpeg
Size: 34921 bytes
Desc: ecg-and-spectral-components.jpg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/990d57ee/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ica-components-basiccorr_data.jpg
Type: image/jpeg
Size: 54720 bytes
Desc: ica-components-basiccorr_data.jpg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/990d57ee/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ica-components-ecg.jpg
Type: image/jpeg
Size: 54720 bytes
Desc: ica-components-ecg.jpg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/990d57ee/attachment-0003.jpg>

From daria.laptinskaya at googlemail.com  Tue Sep 15 11:36:15 2015
From: daria.laptinskaya at googlemail.com (Daria Laptinskaya)
Date: Tue, 15 Sep 2015 11:36:15 +0200
Subject: [FieldTrip] Problem with ft_megrealign
In-Reply-To: <007801d0eba6$10816b80$31844280$@artinis.com>
References: <CADcxnnOuyYNG_X=zcZoEGH0yPnb=mqpNgEK_C0UvyYaJQYvT0A@mail.gmail.com>
 <007801d0eba6$10816b80$31844280$@artinis.com>
Message-ID: <CADcxnnNDRP_DYQGq+uEeqKJVvVd+AEzXNszbPwc1LWC13wqJjw@mail.gmail.com>

Dear Jörn,


thank you very much for your helpful answer! I did not want to answer
before running the function. First I got an error message with the notice
that separate structures of the cfg.template could not be translated into a
variable of the type double (template variable).  Hence I defined the
template variable as a cell-array:

Ntemplate = length(cfg.template);

template = cell(Ntemplate, 1);



and at the end did this:

j = 1;



for i=1:length(template)



    eval(['tp', num2str(j), ' = template{1};'])



    j = j+1;

end



template_new = ([tp1, tp2]);



grad = ft_average_sens(template_new);



Now it works fine, then I leave out the cfg.headshape = ‘hs_file’.  Using
this command is leading to the following error message: Reference to
non-existent field 'xgrid'. I understand the message, but could not fix the
problem till now. I could swear, it worked some time ago :).

I’m sorry to bother you with this, but I would appreciate, if you or
someone else could give me a further tip, how to solve the problem.

Many thank in advance!


Best,

Daria

2015-09-10 10:52 GMT+02:00 Jörn M. Horschig <jorn at artinis.com>:

> Dear Daria,
>
>
>
> try initializing tp_avg just before the for-loop, e.g. by set tp_avg = []
>
>
>
> The error message you got means that you have a function called template
> somewhere in your path. In the command line, you can type
>
> >> which template
>
> to find out where function is located. Afaik it’s not a FieldTrip
> function.  Anyway, to fix this, the template variable should have been
> initialized in the same vein as I described above. I’ll quickly fix this so
> that this does not happen anymore in the new version (from tomorrow
> onwards).
>
> This means, also for you the fix would have been just to initialize the
> template variable rather than renaming the variable, but your solution also
> works fine after initializing the variable ;)
>
>
>
> Best,
>
> Jörn
>
>
>
>
>
>
>
> *--*
>
>
>
> *Jörn M. Horschig, PhD*, Software Engineer
>
> Artinis Medical Systems <http://www.artinis.com/>  |  +31 481 350 980
>
>
>
> *From:* fieldtrip-bounces at science.ru.nl [mailto:
> fieldtrip-bounces at science.ru.nl] *On Behalf Of *Daria Laptinskaya
> *Sent:* Thursday, September 10, 2015 10:39 AM
> *To:* FieldTrip discussion list <fieldtrip at science.ru.nl>
> *Subject:* [FieldTrip] Problem with ft_megrealign
>
>
>
> Dear all,
>
> I would like to apply the ft_megrealign function to MEG data.
>
> First I tried this:
>
>     cfg             = [];
>
>     cfg.vol.r       = 12;
>
>     cfg.vol.o       = [0, 0, 4];
>
>     cfg.template    = allsens;
>
>     cfg.channel     = {'MEG'};
>
>     cfg.inwardshift =  1;
>
>     cfg.headshape   = 'hs_file';
>
>
>
> new_data = ft_megrealign(cfg, old_data);
>
>
>
> Then I got the following error message:
>
> At compilation, "template" was determined to be a variable and this
> variable is
> uninitialized. "template" is also a function name and previous versions of
> MATLAB would
> have called the function. However, MATLAB 7 forbids the use of the same
> name in the same
> context as both a function and a variable.
>
>
>
> I thought that renaming the variable “template” would solve the problem
> and did the following within the original function (replaced the
> template-variable with the Ntp_avg variable):
>
>
>
> Ntp_avg = length(cfg.template);
>
> for i=1:Ntp_avg
>
>   if ischar(cfg.template{i}),
>
>     fprintf('reading template sensor position from %s\n',
> cfg.template{i});
>
>     tp_avg(i) = ft_read_sens(cfg.template{i});
>
>   elseif isstruct(cfg.template{i}) && isfield(cfg.template{i}, 'coilpos')
> && isfield(cfg.template{i}, 'coilori') && isfield(cfg.template{i}, 'tra'),
>
>     tp_avg(i) = cfg.template{i};
>
>   end
>
> end
>
>
>
> No I get an error message, that “the variable tp_avg is not defined”.
>
> Do I forget something? Or do anyone have an other solution for the problem?
>
>
>
> I would appreciate any help / ideas!
>
>
>
> Thanks in advance!
>
>
>
> Best,
>
> Daria
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/923298df/attachment.htm>

From daniel.haehnke at lrz.tu-muenchen.de  Tue Sep 15 12:10:30 2015
From: daniel.haehnke at lrz.tu-muenchen.de (=?utf-8?Q?Daniel_H=C3=A4hnke?=)
Date: Tue, 15 Sep 2015 12:10:30 +0200
Subject: [FieldTrip] Calculation of significant spike-LFP phase-locking
	(pairwise phase-consistency) from a surrogate distribution
Message-ID: <E6F7E39C-1BED-45D5-B826-EB8DAF79CA54@lrz.tum.de>

Dear Fieldtrip community,

I would like to calculate significant spike-LFP phase-locking against a randomly shuffled surrogate null distribution, to find significantly locked electrode pairs. As a measure for phase-locking I use the pairwise phase-consistency (PPC0).

However, I am not quite clear as to what I should be shuffling to get the surrogate distribution. The input to ft_spiketriggeredspectrum_stat is the spike-triggered spectrum from ft_spiketriggeredspectrum (let’s say this structure is named STS).
Nothing changes in the PPC values if I shuffle the sequence of STS.time or STS.trial. This is a bit odd, as I am not computing PPC for the entire trial, and changing the spike timing should at least have some impact.

So now all I can think of is either shuffling the imaginary part of STS.fourierspctrm to generate random phases OR shuffling the trial sequence of spikes or LFPs prior to computing the spike-triggered spectrum. The latter of course will be very computationally demanding.

Any ideas?

Best wishes,

Daniel
--
Daniel Hähnke
PhD student

Technische Universität München
Institute of Neuroscience
Translational NeuroCognition Laboratory
Biedersteiner Straße 29, Bau 601
80802 Munich
Germany

Email: daniel.haehnke at lrz.tum.de
Phone: +49 89 4140 3356

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

From sid.kouider at gmail.com  Tue Sep 15 15:51:31 2015
From: sid.kouider at gmail.com (Sid Kouider)
Date: Tue, 15 Sep 2015 15:51:31 +0200
Subject: [FieldTrip] Research Engineer Position in EEG BCI - NeuroVirtual
	project in Paris
Message-ID: <D21C4B64.7BD85%sid.kouider@ens.fr>



The Institute of Cognitive Science at the Ecole Normale Supérieure (Paris)
is offering 


- A research engineer position to work on EEG, Machine Learning and
Brain-Computer Interfaces.
 
You will be part of a team of engineers and researchers in cognitive
neuroscience working on the measurement of EEG neural signals to infer
various cognitive functions (perception, decision-making, attention,
learning, sleep).
You will mainly be in charge of optimizing the online detection of specific
EEG markers of learning and auditory attention, and will be in charge of
optimizing a BCI loop between a virtual environment and a portable EEG
system. 
You will be affiliated to the Brain and Consciousness team of Pr Sid Kouider
(http://www.lscp.net/persons/sidk/). Our lab has been successful in using
EEG signals to resolve important issues within the field of cognitive
neuroscience (with recent publications in Science, Current Biology, Nature
Communications, etc). We are now using our expertise in cognitive
neuroscience to develop, in collaboration with the industry, some innovative
serious game applications.


This project is carried out under the framework of the NeuroVirtual projet
(2015-2017), bringing together the fields of cognitive neuroscience and
serious games. Our lab is located in central Paris, within the historical
Quartier Latin.


Candidates should have at least a master or engineering degree in a relevant
domain (Biomedical Engineering, Electrical Engineering, Computer Science,
Applied Mathematics, Physics, or a closely related field) and a solid
training in BCI and fast calculations for real-time applications. Strong
analytical and programming skills, experience with Machine Learning and
expertise in EEG signal processing are absolutely required. Experience with
real virtuality and/or cognitive neuroscience are desirable but not a
prerequisite.  


The appointment is for one year initially but can be extended later on.
The net salary will range between 2 100 and 2 500 euros/month depending on
qualifications.
 
Knowledge of French is not required as the team is international and verbal
interactions are primarily in English.
 
Please send a CV  to Sid Kouider (sid.kouider at ens dot fr) and Cécile
Girard (cecilegirard20 at gmail dot com).

Do not hesitate to contact us for further questions.

Closing date: January 2016




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

From icelandhouse at gmail.com  Tue Sep 15 16:46:47 2015
From: icelandhouse at gmail.com (Maris Skujevskis)
Date: Tue, 15 Sep 2015 16:46:47 +0200
Subject: [FieldTrip] Why inward shift in ft_prepare_sourcemodel?
Message-ID: <CAKEvDifrHnkvWK9OwyU0Boo_QVGOewz6WV6Boo0NDsfM5JLqyA@mail.gmail.com>

Dear Fieldtrip community,

In ft_prepare_sourcemodel there is an option the meaning of which is not
clear to me.

>From ft_prepare_sourcemodel reference documentation:
%cfg.inwardshift  = number, how much should the innermost surface be moved
inward to constrain
%                      sources to be considered inside the source
compartment (default = 0)

In a fieldtrip tutorial this value is set to cfg.inwardshift = -1.5, but it
does not expain why..
http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space

Can someone explain what the practical purpose of this option is, i.e.,
what problem does it address? Naively speaking, I would not have this
option at all and always have the value at zero - why should the surface be
shifted at all? Inside is inside, and outside is outside, right? Clearly I
am missing something here...

Thanks in advance,
Maris




On Tue, Sep 15, 2015 at 12:00 PM, <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
>         http://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: Problem with ft_megrealign (Daria Laptinskaya)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 15 Sep 2015 11:36:15 +0200
> From: Daria Laptinskaya <daria.laptinskaya at googlemail.com>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Problem with ft_megrealign
> Message-ID:
>         <
> CADcxnnNDRP_DYQGq+uEeqKJVvVd+AEzXNszbPwc1LWC13wqJjw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear J?rn,
>
>
> thank you very much for your helpful answer! I did not want to answer
> before running the function. First I got an error message with the notice
> that separate structures of the cfg.template could not be translated into a
> variable of the type double (template variable).  Hence I defined the
> template variable as a cell-array:
>
> Ntemplate = length(cfg.template);
>
> template = cell(Ntemplate, 1);
>
>
>
> and at the end did this:
>
> j = 1;
>
>
>
> for i=1:length(template)
>
>
>
>     eval(['tp', num2str(j), ' = template{1};'])
>
>
>
>     j = j+1;
>
> end
>
>
>
> template_new = ([tp1, tp2]);
>
>
>
> grad = ft_average_sens(template_new);
>
>
>
> Now it works fine, then I leave out the cfg.headshape = ?hs_file?.  Using
> this command is leading to the following error message: Reference to
> non-existent field 'xgrid'. I understand the message, but could not fix the
> problem till now. I could swear, it worked some time ago :).
>
> I?m sorry to bother you with this, but I would appreciate, if you or
> someone else could give me a further tip, how to solve the problem.
>
> Many thank in advance!
>
>
> Best,
>
> Daria
>
> 2015-09-10 10:52 GMT+02:00 J?rn M. Horschig <jorn at artinis.com>:
>
> > Dear Daria,
> >
> >
> >
> > try initializing tp_avg just before the for-loop, e.g. by set tp_avg = []
> >
> >
> >
> > The error message you got means that you have a function called template
> > somewhere in your path. In the command line, you can type
> >
> > >> which template
> >
> > to find out where function is located. Afaik it?s not a FieldTrip
> > function.  Anyway, to fix this, the template variable should have been
> > initialized in the same vein as I described above. I?ll quickly fix this
> so
> > that this does not happen anymore in the new version (from tomorrow
> > onwards).
> >
> > This means, also for you the fix would have been just to initialize the
> > template variable rather than renaming the variable, but your solution
> also
> > works fine after initializing the variable ;)
> >
> >
> >
> > Best,
> >
> > J?rn
> >
> >
> >
> >
> >
> >
> >
> > *--*
> >
> >
> >
> > *J?rn M. Horschig, PhD*, Software Engineer
> >
> > Artinis Medical Systems <http://www.artinis.com/>  |  +31 481 350 980
> >
> >
> >
> > *From:* fieldtrip-bounces at science.ru.nl [mailto:
> > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Daria Laptinskaya
> > *Sent:* Thursday, September 10, 2015 10:39 AM
> > *To:* FieldTrip discussion list <fieldtrip at science.ru.nl>
> > *Subject:* [FieldTrip] Problem with ft_megrealign
> >
> >
> >
> > Dear all,
> >
> > I would like to apply the ft_megrealign function to MEG data.
> >
> > First I tried this:
> >
> >     cfg             = [];
> >
> >     cfg.vol.r       = 12;
> >
> >     cfg.vol.o       = [0, 0, 4];
> >
> >     cfg.template    = allsens;
> >
> >     cfg.channel     = {'MEG'};
> >
> >     cfg.inwardshift =  1;
> >
> >     cfg.headshape   = 'hs_file';
> >
> >
> >
> > new_data = ft_megrealign(cfg, old_data);
> >
> >
> >
> > Then I got the following error message:
> >
> > At compilation, "template" was determined to be a variable and this
> > variable is
> > uninitialized. "template" is also a function name and previous versions
> of
> > MATLAB would
> > have called the function. However, MATLAB 7 forbids the use of the same
> > name in the same
> > context as both a function and a variable.
> >
> >
> >
> > I thought that renaming the variable ?template? would solve the problem
> > and did the following within the original function (replaced the
> > template-variable with the Ntp_avg variable):
> >
> >
> >
> > Ntp_avg = length(cfg.template);
> >
> > for i=1:Ntp_avg
> >
> >   if ischar(cfg.template{i}),
> >
> >     fprintf('reading template sensor position from %s\n',
> > cfg.template{i});
> >
> >     tp_avg(i) = ft_read_sens(cfg.template{i});
> >
> >   elseif isstruct(cfg.template{i}) && isfield(cfg.template{i}, 'coilpos')
> > && isfield(cfg.template{i}, 'coilori') && isfield(cfg.template{i},
> 'tra'),
> >
> >     tp_avg(i) = cfg.template{i};
> >
> >   end
> >
> > end
> >
> >
> >
> > No I get an error message, that ?the variable tp_avg is not defined?.
> >
> > Do I forget something? Or do anyone have an other solution for the
> problem?
> >
> >
> >
> > I would appreciate any help / ideas!
> >
> >
> >
> > Thanks in advance!
> >
> >
> >
> > Best,
> >
> > Daria
> >
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/923298df/attachment-0001.html
> >
>
> ------------------------------
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> End of fieldtrip Digest, Vol 58, Issue 14
> *****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/4e9c7345/attachment.htm>

From manish.saggar at gmail.com  Wed Sep 16 07:29:04 2015
From: manish.saggar at gmail.com (Manish Saggar)
Date: Tue, 15 Sep 2015 22:29:04 -0700
Subject: [FieldTrip] Job posting - Research Assistant/Data Analyst |
 Stanford University School of Medicine
Message-ID: <CAAo7_Mts9TUAoZ7_Cs16yiWQTNUeTiXe=LR8qHe8z+2To3M7Hg@mail.gmail.com>

[Apologies for cross-posting]

The Center for Interdisciplinary Brain Sciences Research (CIBSR) in the
department of Psychiatry at Stanford University School of Medicine is
seeking a full-time Research Assistant (Non-Clinical) to help with
analyzing large-scale neuroimaging (fMRI/NIRS/EEG) and behavioral datasets
from both healthy and patient populations.
Responsibilities will include:-Developing software/scripts to implement
algorithms for data control, data preprocessing/analysis, database
management and coordinating data-sharing initiatives-Developing/running
machine learning algorithms to better understand high-dimensional
datasets-Assisting in analyzing research data using specific fMRI
Neuroimaging programs and/or software (e.g., FSL, AFNI). -Helping with
designing and developing novel neuroimaging paradigms for data
collection-Collecting new neuroimaging/behavioral data
Applicants should have:-B.S. (or higher) in electrical engineering,
biomedical engineering, computer science, or other related scientific
fields-Strong programming skills in Python, Matlab, or similar
languages.-Experience with data science related projects-Prior research
experience (preferred)-Experience with UNIX Operating systems (e.g., Linux,
Mac OSX) and shell scripting (preferred)
General Info: -The applicant will work closely with the team of faculty,
post-docs, and research coordinators to track project progress, meet
deadlines, anticipate project needs and communicate with project
collaborators outside of the lab, train and supervise undergraduate
students to assist with data processing, and train other staff as
needed. -May require extended or unusual work hours based on research
requirements and business needs.
Salary and Anticipated Start Date:  -Salary is competitive and commensurate
with experience/educational qualifications. Anticipated Start Date is
immediate.
Application details: - Please email Manish Saggar (saggar at stanford.edu) to
apply, please include a CV including the names of 3 references with your
inquiry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/1991584b/attachment.htm>

From johanna.zumer at gmail.com  Wed Sep 16 12:00:28 2015
From: johanna.zumer at gmail.com (Johanna Zumer)
Date: Wed, 16 Sep 2015 10:00:28 +0000
Subject: [FieldTrip] Lecturer position in computational neuroscience, at CNCR,
 Uni Bham, UK
Message-ID: <78a94e3a4a5244c78d6dbd373adc9b86@EXPRD01.hosting.ru.nl>

Dear all,

Please see below for a fixed-term teaching-based lecturer position available at Birmingham.  The application deadline is 21 September, so act soon!

Regards,
Johanna

---------- Forwarded message ----------
From: Uta Noppeney <U.Noppeney at bham.ac.uk<mailto:U.Noppeney at bham.ac.uk>>
Date: 2015-09-08 12:12 GMT+01:00
Subject: [CN-CR] lecturer position in computational neuroscience, at CNCR, Uni Bham, UK
To: Jeremy L Wyatt <J.L.Wyatt at cs.bham.ac.uk<mailto:J.L.Wyatt at cs.bham.ac.uk>>, Ales Leonardis <a.Leonardis at cs.bham.ac.uk<mailto:a.Leonardis at cs.bham.ac.uk>>, Peter Tino <P.Tino at cs.bham.ac.uk<mailto:P.Tino at cs.bham.ac.uk>>, msc-cncr at lists.bham.ac.uk<mailto:msc-cncr at lists.bham.ac.uk>, cn-cr at cs.bham.ac.uk<mailto:cn-cr at cs.bham.ac.uk>


DearAll,

we have an open teaching-focused lecturer position in computational neuroscience and modelling.
We would be very grateful if you could forward the link to potentially interested candidates at this and other institutions.

https://atsv7.wcn.co.uk/search_engine/jobs.cgi?amNvZGU9MTQ4ODU2OSZ2dF90ZW1wbGF0ZT03Njcmb3duZXI9NTAzMjUyMSZvd25lcnR5cGU9ZmFpciZicmFuZF9pZD0wJmxvY2F0aW9uX2NvZGU9MTU0NDQmb2NjX2NvZGU9NjcyMiZwb3N0aW5nX2NvZGU9MTE3JnJlcXNpZz0xNDQxNzA5MDM4LWVjZTNlYzY4N2NlNzFiODcxNzU2M2MxN2Y4ZWY2MGFjZjg3OWFiNTc%3D&jcode=1488569&vt_template=767&owner=5032521&ownertype=fair&brand_id=0&location_code=15444&occ_code=6722&posting_code=117&reqsig=1441709038-ece3ec687ce71b8717563c17f8ef60acf879ab57

Many thanks and Best wishes
Uta


_______________________________________________
cn-cr mailing list
cn-cr at cs.bham.ac.uk<mailto:cn-cr at cs.bham.ac.uk>
https://mailman.cs.bham.ac.uk/mailman/listinfo/cn-cr

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

From s.aurtenetxe at bcbl.eu  Wed Sep 16 15:21:44 2015
From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe)
Date: Wed, 16 Sep 2015 15:21:44 +0200 (CEST)
Subject: [FieldTrip] Leadfield of one condition with two different 'grad'
	structures
Message-ID: <941858791.92311.1442409704382.JavaMail.zimbra@bcbl.eu>

Dear all, 

I would appreciate to get some advice on the following.

I am computing the leadfield (ft_prepare_leadfield) for the subsequent source analysis (ft_sourceanalysis) of ERF data acquired with Elekta Neuromag system. 
My experiment is acquired in a unique run, including 3 randomized conditions for each participant normally. 
Therefore, the unique 'cfg.grad' structure is used for the leadfield computation of each participant.

However, due to a must, the experiment was recorded into two independent runs (splited) for one of the participants. Here comes the issue: 
Given that the 'grad' structure is specific to each run, this participant turns to with two different 'grad' structures for the same condition.

My question is: which is the most suitable approach to compute the leadfield of one condition when the data comes from two different runs, so when having two different 'grad' structures?

I would say that I should compute the leadfield and the sourceanalysis for each run and condition separately, and then join the solutions of the same condition. 
But I wonder if this is a correct approach and/or if there is any additional/more appropriate approach for that. 

Any comment will be very appreciated.

Thank you in advance.
Best,

Sara






From smoratti at psi.ucm.es  Wed Sep 16 15:57:30 2015
From: smoratti at psi.ucm.es (smoratti at psi.ucm.es)
Date: Wed, 16 Sep 2015 15:57:30 +0200
Subject: [FieldTrip] Leadfield of one condition with two different
	'grad' structures
In-Reply-To: <941858791.92311.1442409704382.JavaMail.zimbra@bcbl.eu>
References: <941858791.92311.1442409704382.JavaMail.zimbra@bcbl.eu>
Message-ID: <7FEF33B7-4B83-4206-8A8D-92988F50AE64@psi.ucm.es>

Dear Sara,

Did you measure for each run the HPC coil position in order to determine the relative sensor position with respect to the head? If so, you could calculate the lead field for each run separately, source localize for each run and then collapse the runs after source localization.

Best,

Stephan


________________________________________________________
Stephan Moratti, PhD

see: Stephan's research profile

Universidad Complutense de Madrid
Facultad de Psicología
Departamento de Psicología Básica I
Campus de Somosaguas
Despacho (Office) 1326-0 
28223 Pozuelo de Alarcón (Madrid)
Spain

and

Center for Biomedical Technology
Laboratory for Cognitive and Computational Neuroscience
Parque Científico y Tecnológico de la Universidad Politecnica de Madrid
Campus Montegancedo
28223 Pozuelo de Alarcón (Madrid)
Spain


email: smoratti at psi.ucm.es
Tel.:    +34 679219982

El 16/09/2015, a las 15:21, Sara Aurtenetxe escribió:

> Dear all, 
> 
> I would appreciate to get some advice on the following.
> 
> I am computing the leadfield (ft_prepare_leadfield) for the subsequent source analysis (ft_sourceanalysis) of ERF data acquired with Elekta Neuromag system. 
> My experiment is acquired in a unique run, including 3 randomized conditions for each participant normally. 
> Therefore, the unique 'cfg.grad' structure is used for the leadfield computation of each participant.
> 
> However, due to a must, the experiment was recorded into two independent runs (splited) for one of the participants. Here comes the issue: 
> Given that the 'grad' structure is specific to each run, this participant turns to with two different 'grad' structures for the same condition.
> 
> My question is: which is the most suitable approach to compute the leadfield of one condition when the data comes from two different runs, so when having two different 'grad' structures?
> 
> I would say that I should compute the leadfield and the sourceanalysis for each run and condition separately, and then join the solutions of the same condition. 
> But I wonder if this is a correct approach and/or if there is any additional/more appropriate approach for that. 
> 
> Any comment will be very appreciated.
> 
> Thank you in advance.
> Best,
> 
> Sara
> 
> 
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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

From helen.wieffering at gmail.com  Wed Sep 16 16:00:05 2015
From: helen.wieffering at gmail.com (Helen Wieffering)
Date: Wed, 16 Sep 2015 10:00:05 -0400
Subject: [FieldTrip] Aligning electrodes to template head model
In-Reply-To: <AA21F9F31911364596BE68CA1AAD8DA466E1F914@x10-mbx13.yu.yale.edu>
References: <CAPayXFwPgwYcafEPnyT404HR52QtuLjMWS5yJ=CJM0U03gYMdQ@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F914@x10-mbx13.yu.yale.edu>
Message-ID: <CAPayXFzowWEv1SGcz7=FpsBXX56qA6WFs--tWOPRWf5-tBDTaA@mail.gmail.com>

Hi Jia,
Thanks so much for getting back to me. If you have a free moment, would you
mind looking over my code? I have tried the tutorial steps many times, even
having changed the label of the GSN fiducials to 'Nz', 'LPA', 'RPA',  but
seem to keep getting the same incorrect results.

% ALIGN ELECTRODES TO STANDARD_BEM

% read electrode coordinates
elec = ft_read_sens('GSN-HydroCel-129.sfp');

% convert units to mm to match units of headmodel
elec = ft_convert_units(elec, 'mm');

% change label of fiducials
elec.label{1} = 'Nz';
elec.label{2} = 'LPA'
elec.label{3} = 'RPA';

% create fiducial structure
% draw fiducial coordinates from mri
nas = standard_mri.hdr.fiducial.mri.nas;
lpa = standard_mri.hdr.fiducial.mri.lpa;
rpa = standard_mri.hdr.fiducial.mri.rpa;

transm = standard_mri.transform;

nas = ft_warp_apply(transm, nas, 'homogenous');
lpa = ft_warp_apply(transm, lpa, 'homogenous');
rpa = ft_warp_apply(transm, rpa, 'homogenous');

% create a structure similar to a template set of electrodes
fid.chanpos = [nas; lpa; rpa]; % mni-coordinates of fiducials
fid.label = {'Nz','LPA','RPA'}; % same labels as in elec
fid.unit = 'mm'; % same units as mri

% alignment
cfg = [];
cfg.method = 'fiducial';
cfg.template = fid; % see above
cfg.elec = elec;
cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in
elec
elec_aligned = ft_electroderealign(cfg);

% plot to check
figure;
ft_plot_mesh(standard_bem.bnd(1),
'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]);
hold on;
ft_plot_sens(elec_aligned,'style', 'sk');

For reference, the coordinates I get in the structure fid are the following:
fid =

    chanpos: [3x3 double]
      label: {'Nz'  'LPA'  'RPA'}
       unit: 'mm'

fid.chanpos

ans =

    35   -36     0
   118   -35     0
   -82   -35     0


If those are different from yours, would you let me know? I'm trying to
find out at which step I went wrong.
Again, thank you very much!

Best,
Helen


On Mon, Sep 14, 2015 at 11:00 PM, Wu, Jia <jia.wu at yale.edu> wrote:

> Helen,
>
> What a coincident. I'm also working on source analysis on EEG data using
> GSN HydroCel 128. I had a post a couple weeks ago about later steps. But I
> did get the alignment to work. The picture you posted looked like the
> status before the alignment. So i suspect that alignment did not happen.
>
> I'm not sure whether you have noticed it, but the fiducial positions in
> elec location file were called 'FidNz', 'FidT9', 'FidT10', instead of 'Nz','LPA','RPA'
> as in the tutorial. So they need to be changed. Then the alignment should
> work.
>
> best,
> -jia
>
> ------------------------------
> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
> on behalf of Helen Wieffering [helen.wieffering at gmail.com]
> *Sent:* Monday, September 14, 2015 4:46 PM
> *To:* FieldTrip discussion list
> *Subject:* [FieldTrip] Aligning electrodes to template head model
>
> Hello all,
>
> I have a quick question on aligning electrodes to the standard_bem
> headmodel, which I downloaded from the FT server.
>
> Namely, are the standard_mri and the standard_bem in the same coordinate
> system? I assumed this would be so, since one was developed from the other.
> But when I try to align my electrodes to the standard_bem volume using
> fiducial positions from the standard_mri, I get very strange results:
> (image below and attached)
>
> [image: Inline image 1]
>
> I'm using a GSN HydroCel 128 Cap, and my elec structure contains the
> fiducial positions relative to the electrodes.
> I've been following the tutorial at
> http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_tutorial_headmodel-5Feeg&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=wNRiA8CLR4Y1ZrEaTkTaIoVaUczL5TYuWIx6FyQDphg&s=LjU77qpw8I7LnSHIEQrNIB0R0YLrutfAEtjjOMjBys0&e=>
> and would like to follow the steps under 'Automatic Alignment', but as I
> said: pulling the fiducial positions from the standard_mri seems to not
> work with the tutorial steps.
>
> Any help is appreciated - thanks in advance!
>
> Helen Wieffering
> Bowdoin College
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150916/84a84d7b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unaligned.jpg
Type: image/jpeg
Size: 13372 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150916/84a84d7b/attachment.jpg>

From jia.wu at yale.edu  Wed Sep 16 17:59:17 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Wed, 16 Sep 2015 15:59:17 +0000
Subject: [FieldTrip] Aligning electrodes to template head model
In-Reply-To: <CAPayXFzowWEv1SGcz7=FpsBXX56qA6WFs--tWOPRWf5-tBDTaA@mail.gmail.com>
References: <CAPayXFwPgwYcafEPnyT404HR52QtuLjMWS5yJ=CJM0U03gYMdQ@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F914@x10-mbx13.yu.yale.edu>,
 <CAPayXFzowWEv1SGcz7=FpsBXX56qA6WFs--tWOPRWf5-tBDTaA@mail.gmail.com>
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E1FB9E@x10-mbx13.yu.yale.edu>

Helen,
I ran your code and it seemed to work with the mri and headmodel I have. I looked back at the picture you sent originally. It looks like the electrodes were aligned (before alignment, the tip of the head is facing upwards, after alignment with the mri provided by the wiki it points to the right), but the headmodel is not plotted correctly. The headmodel needs to be driven from mri. You can double check the headmodel, which is standard_bem in your code.
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helen Wieffering [helen.wieffering at gmail.com]
Sent: Wednesday, September 16, 2015 10:00 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Aligning electrodes to template head model

Hi Jia,
Thanks so much for getting back to me. If you have a free moment, would you mind looking over my code? I have tried the tutorial steps many times, even having changed the label of the GSN fiducials to 'Nz', 'LPA', 'RPA',  but seem to keep getting the same incorrect results.

% ALIGN ELECTRODES TO STANDARD_BEM

% read electrode coordinates
elec = ft_read_sens('GSN-HydroCel-129.sfp');

% convert units to mm to match units of headmodel
elec = ft_convert_units(elec, 'mm');

% change label of fiducials
elec.label{1} = 'Nz';
elec.label{2} = 'LPA'
elec.label{3} = 'RPA';

% create fiducial structure
% draw fiducial coordinates from mri
nas = standard_mri.hdr.fiducial.mri.nas;
lpa = standard_mri.hdr.fiducial.mri.lpa;
rpa = standard_mri.hdr.fiducial.mri.rpa;

transm = standard_mri.transform;

nas = ft_warp_apply(transm, nas, 'homogenous');
lpa = ft_warp_apply(transm, lpa, 'homogenous');
rpa = ft_warp_apply(transm, rpa, 'homogenous');

% create a structure similar to a template set of electrodes
fid.chanpos = [nas; lpa; rpa]; % mni-coordinates of fiducials
fid.label = {'Nz','LPA','RPA'}; % same labels as in elec
fid.unit = 'mm'; % same units as mri

% alignment
cfg = [];
cfg.method = 'fiducial';
cfg.template = fid; % see above
cfg.elec = elec;
cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec
elec_aligned = ft_electroderealign(cfg);

% plot to check
figure;
ft_plot_mesh(standard_bem.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]);
hold on;
ft_plot_sens(elec_aligned,'style', 'sk');

For reference, the coordinates I get in the structure fid are the following:
fid =

    chanpos: [3x3 double]
      label: {'Nz'  'LPA'  'RPA'}
       unit: 'mm'

fid.chanpos

ans =

    35   -36     0
   118   -35     0
   -82   -35     0


If those are different from yours, would you let me know? I'm trying to find out at which step I went wrong.
Again, thank you very much!

Best,
Helen


On Mon, Sep 14, 2015 at 11:00 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
Helen,

What a coincident. I'm also working on source analysis on EEG data using GSN HydroCel 128. I had a post a couple weeks ago about later steps. But I did get the alignment to work. The picture you posted looked like the status before the alignment. So i suspect that alignment did not happen.

I'm not sure whether you have noticed it, but the fiducial positions in elec location file were called 'FidNz', 'FidT9', 'FidT10', instead of 'Nz','LPA','RPA' as in the tutorial. So they need to be changed. Then the alignment should work.

best,
-jia

________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Helen Wieffering [helen.wieffering at gmail.com<mailto:helen.wieffering at gmail.com>]
Sent: Monday, September 14, 2015 4:46 PM
To: FieldTrip discussion list
Subject: [FieldTrip] Aligning electrodes to template head model

Hello all,

I have a quick question on aligning electrodes to the standard_bem headmodel, which I downloaded from the FT server.

Namely, are the standard_mri and the standard_bem in the same coordinate system? I assumed this would be so, since one was developed from the other. But when I try to align my electrodes to the standard_bem volume using fiducial positions from the standard_mri, I get very strange results: (image below and attached)

[Inline image 1]

I'm using a GSN HydroCel 128 Cap, and my elec structure contains the fiducial positions relative to the electrodes.
I've been following the tutorial at http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_tutorial_headmodel-5Feeg&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=wNRiA8CLR4Y1ZrEaTkTaIoVaUczL5TYuWIx6FyQDphg&s=LjU77qpw8I7LnSHIEQrNIB0R0YLrutfAEtjjOMjBys0&e=> and would like to follow the steps under 'Automatic Alignment', but as I said: pulling the fiducial positions from the standard_mri seems to not work with the tutorial steps.

Any help is appreciated - thanks in advance!

Helen Wieffering
Bowdoin College

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=kW18ZarjEMl0kcSTFdA9daM4KYcFZdGymg7wgboAsmc&s=9wDX5VD5t6xGdP84l_wit7DYMhK57vFlE5v1OkxjFgA&e=>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150916/4889c1a1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unaligned.jpg
Type: image/jpeg
Size: 13372 bytes
Desc: unaligned.jpg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150916/4889c1a1/attachment.jpg>

From helen.wieffering at gmail.com  Wed Sep 16 21:50:21 2015
From: helen.wieffering at gmail.com (Helen Wieffering)
Date: Wed, 16 Sep 2015 15:50:21 -0400
Subject: [FieldTrip] Aligning electrodes to template head model
In-Reply-To: <AA21F9F31911364596BE68CA1AAD8DA466E1FB9E@x10-mbx13.yu.yale.edu>
References: <CAPayXFwPgwYcafEPnyT404HR52QtuLjMWS5yJ=CJM0U03gYMdQ@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F914@x10-mbx13.yu.yale.edu>
 <CAPayXFzowWEv1SGcz7=FpsBXX56qA6WFs--tWOPRWf5-tBDTaA@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1FB9E@x10-mbx13.yu.yale.edu>
Message-ID: <CAPayXFwacM8c0kRS2XKZ+y7FAfH86HYX9N0ZMf4Lu3qMSSNgMQ@mail.gmail.com>

Hi Jia,
Thanks so much for taking the time to help me. I'll try what you suggested
and see how it goes!

Best,
Helen

On Wed, Sep 16, 2015 at 11:59 AM, Wu, Jia <jia.wu at yale.edu> wrote:

> Helen,
> I ran your code and it seemed to work with the mri and headmodel I have. I
> looked back at the picture you sent originally. It looks like the
> electrodes were aligned (before alignment, the tip of the head is facing
> upwards, after alignment with the mri provided by the wiki it points to the
> right), but the headmodel is not plotted correctly. The headmodel needs to
> be driven from mri. You can double check the headmodel, which is standard_bem
> in your code.
> -jia
> ------------------------------
> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
> on behalf of Helen Wieffering [helen.wieffering at gmail.com]
> *Sent:* Wednesday, September 16, 2015 10:00 AM
> *To:* FieldTrip discussion list
> *Subject:* Re: [FieldTrip] Aligning electrodes to template head model
>
> Hi Jia,
> Thanks so much for getting back to me. If you have a free moment, would
> you mind looking over my code? I have tried the tutorial steps many times,
> even having changed the label of the GSN fiducials to 'Nz', 'LPA', 'RPA',
> but seem to keep getting the same incorrect results.
>
> % ALIGN ELECTRODES TO STANDARD_BEM
>
> % read electrode coordinates
> elec = ft_read_sens('GSN-HydroCel-129.sfp');
>
> % convert units to mm to match units of headmodel
> elec = ft_convert_units(elec, 'mm');
>
> % change label of fiducials
> elec.label{1} = 'Nz';
> elec.label{2} = 'LPA'
> elec.label{3} = 'RPA';
>
> % create fiducial structure
> % draw fiducial coordinates from mri
> nas = standard_mri.hdr.fiducial.mri.nas;
> lpa = standard_mri.hdr.fiducial.mri.lpa;
> rpa = standard_mri.hdr.fiducial.mri.rpa;
>
> transm = standard_mri.transform;
>
> nas = ft_warp_apply(transm, nas, 'homogenous');
> lpa = ft_warp_apply(transm, lpa, 'homogenous');
> rpa = ft_warp_apply(transm, rpa, 'homogenous');
>
> % create a structure similar to a template set of electrodes
> fid.chanpos = [nas; lpa; rpa]; % mni-coordinates of fiducials
> fid.label = {'Nz','LPA','RPA'}; % same labels as in elec
> fid.unit = 'mm'; % same units as mri
>
> % alignment
> cfg = [];
> cfg.method = 'fiducial';
> cfg.template = fid; % see above
> cfg.elec = elec;
> cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in
> elec
> elec_aligned = ft_electroderealign(cfg);
>
> % plot to check
> figure;
> ft_plot_mesh(standard_bem.bnd(1),
> 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]);
> hold on;
> ft_plot_sens(elec_aligned,'style', 'sk');
>
> For reference, the coordinates I get in the structure fid are the
> following:
> fid =
>
>     chanpos: [3x3 double]
>       label: {'Nz'  'LPA'  'RPA'}
>        unit: 'mm'
>
> fid.chanpos
>
> ans =
>
>     35   -36     0
>    118   -35     0
>    -82   -35     0
>
>
> If those are different from yours, would you let me know? I'm trying to
> find out at which step I went wrong.
> Again, thank you very much!
>
> Best,
> Helen
>
>
> On Mon, Sep 14, 2015 at 11:00 PM, Wu, Jia <jia.wu at yale.edu> wrote:
>
>> Helen,
>>
>> What a coincident. I'm also working on source analysis on EEG data using
>> GSN HydroCel 128. I had a post a couple weeks ago about later steps. But I
>> did get the alignment to work. The picture you posted looked like the
>> status before the alignment. So i suspect that alignment did not happen.
>>
>> I'm not sure whether you have noticed it, but the fiducial positions in
>> elec location file were called 'FidNz', 'FidT9', 'FidT10', instead of 'Nz','LPA','RPA'
>> as in the tutorial. So they need to be changed. Then the alignment should
>> work.
>>
>> best,
>> -jia
>>
>> ------------------------------
>> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
>> on behalf of Helen Wieffering [helen.wieffering at gmail.com]
>> *Sent:* Monday, September 14, 2015 4:46 PM
>> *To:* FieldTrip discussion list
>> *Subject:* [FieldTrip] Aligning electrodes to template head model
>>
>> Hello all,
>>
>> I have a quick question on aligning electrodes to the standard_bem
>> headmodel, which I downloaded from the FT server.
>>
>> Namely, are the standard_mri and the standard_bem in the same coordinate
>> system? I assumed this would be so, since one was developed from the other.
>> But when I try to align my electrodes to the standard_bem volume using
>> fiducial positions from the standard_mri, I get very strange results:
>> (image below and attached)
>>
>> [image: Inline image 1]
>>
>> I'm using a GSN HydroCel 128 Cap, and my elec structure contains the
>> fiducial positions relative to the electrodes.
>> I've been following the tutorial at
>> http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_tutorial_headmodel-5Feeg&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=wNRiA8CLR4Y1ZrEaTkTaIoVaUczL5TYuWIx6FyQDphg&s=LjU77qpw8I7LnSHIEQrNIB0R0YLrutfAEtjjOMjBys0&e=>
>> and would like to follow the steps under 'Automatic Alignment', but as I
>> said: pulling the fiducial positions from the standard_mri seems to not
>> work with the tutorial steps.
>>
>> Any help is appreciated - thanks in advance!
>>
>> Helen Wieffering
>> Bowdoin College
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=kW18ZarjEMl0kcSTFdA9daM4KYcFZdGymg7wgboAsmc&s=9wDX5VD5t6xGdP84l_wit7DYMhK57vFlE5v1OkxjFgA&e=>
>>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150916/8a11a183/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unaligned.jpg
Type: image/jpeg
Size: 13372 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150916/8a11a183/attachment.jpg>

From helen.wieffering at gmail.com  Thu Sep 17 02:20:12 2015
From: helen.wieffering at gmail.com (Helen Wieffering)
Date: Wed, 16 Sep 2015 20:20:12 -0400
Subject: [FieldTrip] Aligning electrodes to template head model
In-Reply-To: <CAPayXFwacM8c0kRS2XKZ+y7FAfH86HYX9N0ZMf4Lu3qMSSNgMQ@mail.gmail.com>
References: <CAPayXFwPgwYcafEPnyT404HR52QtuLjMWS5yJ=CJM0U03gYMdQ@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F914@x10-mbx13.yu.yale.edu>
 <CAPayXFzowWEv1SGcz7=FpsBXX56qA6WFs--tWOPRWf5-tBDTaA@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1FB9E@x10-mbx13.yu.yale.edu>
 <CAPayXFwacM8c0kRS2XKZ+y7FAfH86HYX9N0ZMf4Lu3qMSSNgMQ@mail.gmail.com>
Message-ID: <CAPayXFyY_Y8TQfczehANLdovgiT=ZyNUr2Nqe-gec_+KfFK6=Q@mail.gmail.com>

Hi again, Jia,
I agree- something must be going wrong when I plot the head model, or maybe
when I warp the fiducial coordinates from the mri, because the alignment is
certainly worse off after I complete all the alignment steps than it was
originally! But since all my steps draw from the standard_mri and
standard_bem, I'm not sure what the problem could be.

My best success has been simply from interactively aligning the electrodes
and verifying it visually. I'm attaching a matlab figure of what it looks
like just in case anyone has input - I think it looks accurately aligned,
but this is my first time creating a head model in field trip so I have
limited experience to draw upon.

As always, thanks for your help.

Best,
Helen Wieffering
Bowdoin College

On Wed, Sep 16, 2015 at 3:50 PM, Helen Wieffering <
helen.wieffering at gmail.com> wrote:

> Hi Jia,
> Thanks so much for taking the time to help me. I'll try what you suggested
> and see how it goes!
>
> Best,
> Helen
>
> On Wed, Sep 16, 2015 at 11:59 AM, Wu, Jia <jia.wu at yale.edu> wrote:
>
>> Helen,
>> I ran your code and it seemed to work with the mri and headmodel I have.
>> I looked back at the picture you sent originally. It looks like the
>> electrodes were aligned (before alignment, the tip of the head is facing
>> upwards, after alignment with the mri provided by the wiki it points to the
>> right), but the headmodel is not plotted correctly. The headmodel needs to
>> be driven from mri. You can double check the headmodel, which is standard_bem
>> in your code.
>> -jia
>> ------------------------------
>> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
>> on behalf of Helen Wieffering [helen.wieffering at gmail.com]
>> *Sent:* Wednesday, September 16, 2015 10:00 AM
>> *To:* FieldTrip discussion list
>> *Subject:* Re: [FieldTrip] Aligning electrodes to template head model
>>
>> Hi Jia,
>> Thanks so much for getting back to me. If you have a free moment, would
>> you mind looking over my code? I have tried the tutorial steps many times,
>> even having changed the label of the GSN fiducials to 'Nz', 'LPA', 'RPA',
>> but seem to keep getting the same incorrect results.
>>
>> % ALIGN ELECTRODES TO STANDARD_BEM
>>
>> % read electrode coordinates
>> elec = ft_read_sens('GSN-HydroCel-129.sfp');
>>
>> % convert units to mm to match units of headmodel
>> elec = ft_convert_units(elec, 'mm');
>>
>> % change label of fiducials
>> elec.label{1} = 'Nz';
>> elec.label{2} = 'LPA'
>> elec.label{3} = 'RPA';
>>
>> % create fiducial structure
>> % draw fiducial coordinates from mri
>> nas = standard_mri.hdr.fiducial.mri.nas;
>> lpa = standard_mri.hdr.fiducial.mri.lpa;
>> rpa = standard_mri.hdr.fiducial.mri.rpa;
>>
>> transm = standard_mri.transform;
>>
>> nas = ft_warp_apply(transm, nas, 'homogenous');
>> lpa = ft_warp_apply(transm, lpa, 'homogenous');
>> rpa = ft_warp_apply(transm, rpa, 'homogenous');
>>
>> % create a structure similar to a template set of electrodes
>> fid.chanpos = [nas; lpa; rpa]; % mni-coordinates of fiducials
>> fid.label = {'Nz','LPA','RPA'}; % same labels as in elec
>> fid.unit = 'mm'; % same units as mri
>>
>> % alignment
>> cfg = [];
>> cfg.method = 'fiducial';
>> cfg.template = fid; % see above
>> cfg.elec = elec;
>> cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in
>> elec
>> elec_aligned = ft_electroderealign(cfg);
>>
>> % plot to check
>> figure;
>> ft_plot_mesh(standard_bem.bnd(1),
>> 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]);
>> hold on;
>> ft_plot_sens(elec_aligned,'style', 'sk');
>>
>> For reference, the coordinates I get in the structure fid are the
>> following:
>> fid =
>>
>>     chanpos: [3x3 double]
>>       label: {'Nz'  'LPA'  'RPA'}
>>        unit: 'mm'
>>
>> fid.chanpos
>>
>> ans =
>>
>>     35   -36     0
>>    118   -35     0
>>    -82   -35     0
>>
>>
>> If those are different from yours, would you let me know? I'm trying to
>> find out at which step I went wrong.
>> Again, thank you very much!
>>
>> Best,
>> Helen
>>
>>
>> On Mon, Sep 14, 2015 at 11:00 PM, Wu, Jia <jia.wu at yale.edu> wrote:
>>
>>> Helen,
>>>
>>> What a coincident. I'm also working on source analysis on EEG data using
>>> GSN HydroCel 128. I had a post a couple weeks ago about later steps. But I
>>> did get the alignment to work. The picture you posted looked like the
>>> status before the alignment. So i suspect that alignment did not happen.
>>>
>>> I'm not sure whether you have noticed it, but the fiducial positions in
>>> elec location file were called 'FidNz', 'FidT9', 'FidT10', instead of 'Nz','LPA','RPA'
>>> as in the tutorial. So they need to be changed. Then the alignment should
>>> work.
>>>
>>> best,
>>> -jia
>>>
>>> ------------------------------
>>> *From:* fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl]
>>> on behalf of Helen Wieffering [helen.wieffering at gmail.com]
>>> *Sent:* Monday, September 14, 2015 4:46 PM
>>> *To:* FieldTrip discussion list
>>> *Subject:* [FieldTrip] Aligning electrodes to template head model
>>>
>>> Hello all,
>>>
>>> I have a quick question on aligning electrodes to the standard_bem
>>> headmodel, which I downloaded from the FT server.
>>>
>>> Namely, are the standard_mri and the standard_bem in the same coordinate
>>> system? I assumed this would be so, since one was developed from the other.
>>> But when I try to align my electrodes to the standard_bem volume using
>>> fiducial positions from the standard_mri, I get very strange results:
>>> (image below and attached)
>>>
>>> [image: Inline image 1]
>>>
>>> I'm using a GSN HydroCel 128 Cap, and my elec structure contains the
>>> fiducial positions relative to the electrodes.
>>> I've been following the tutorial at
>>> http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_tutorial_headmodel-5Feeg&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=wNRiA8CLR4Y1ZrEaTkTaIoVaUczL5TYuWIx6FyQDphg&s=LjU77qpw8I7LnSHIEQrNIB0R0YLrutfAEtjjOMjBys0&e=>
>>> and would like to follow the steps under 'Automatic Alignment', but as I
>>> said: pulling the fiducial positions from the standard_mri seems to not
>>> work with the tutorial steps.
>>>
>>> Any help is appreciated - thanks in advance!
>>>
>>> Helen Wieffering
>>> Bowdoin College
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl
>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=kW18ZarjEMl0kcSTFdA9daM4KYcFZdGymg7wgboAsmc&s=9wDX5VD5t6xGdP84l_wit7DYMhK57vFlE5v1OkxjFgA&e=>
>>>
>>
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150916/daf7c152/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unaligned.jpg
Type: image/jpeg
Size: 13372 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150916/daf7c152/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: head model.fig
Type: application/x-matlab-figure
Size: 176386 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150916/daf7c152/attachment.bin>

From jia.wu at yale.edu  Thu Sep 17 04:13:57 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Thu, 17 Sep 2015 02:13:57 +0000
Subject: [FieldTrip] Aligning electrodes to template head model
In-Reply-To: <CAPayXFyY_Y8TQfczehANLdovgiT=ZyNUr2Nqe-gec_+KfFK6=Q@mail.gmail.com>
References: <CAPayXFwPgwYcafEPnyT404HR52QtuLjMWS5yJ=CJM0U03gYMdQ@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F914@x10-mbx13.yu.yale.edu>
 <CAPayXFzowWEv1SGcz7=FpsBXX56qA6WFs--tWOPRWf5-tBDTaA@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1FB9E@x10-mbx13.yu.yale.edu>
 <CAPayXFwacM8c0kRS2XKZ+y7FAfH86HYX9N0ZMf4Lu3qMSSNgMQ@mail.gmail.com>,
 <CAPayXFyY_Y8TQfczehANLdovgiT=ZyNUr2Nqe-gec_+KfFK6=Q@mail.gmail.com>
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E1FC44@x10-mbx13.yu.yale.edu>

Helen,
Can you find the place where you downloaded the headmodel?
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helen Wieffering [helen.wieffering at gmail.com]
Sent: Wednesday, September 16, 2015 8:20 PM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Aligning electrodes to template head model

Hi again, Jia,
I agree- something must be going wrong when I plot the head model, or maybe when I warp the fiducial coordinates from the mri, because the alignment is certainly worse off after I complete all the alignment steps than it was originally! But since all my steps draw from the standard_mri and standard_bem, I'm not sure what the problem could be.

My best success has been simply from interactively aligning the electrodes and verifying it visually. I'm attaching a matlab figure of what it looks like just in case anyone has input - I think it looks accurately aligned, but this is my first time creating a head model in field trip so I have limited experience to draw upon.

As always, thanks for your help.

Best,
Helen Wieffering
Bowdoin College

On Wed, Sep 16, 2015 at 3:50 PM, Helen Wieffering <helen.wieffering at gmail.com<mailto:helen.wieffering at gmail.com>> wrote:
Hi Jia,
Thanks so much for taking the time to help me. I'll try what you suggested and see how it goes!

Best,
Helen

On Wed, Sep 16, 2015 at 11:59 AM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
Helen,
I ran your code and it seemed to work with the mri and headmodel I have. I looked back at the picture you sent originally. It looks like the electrodes were aligned (before alignment, the tip of the head is facing upwards, after alignment with the mri provided by the wiki it points to the right), but the headmodel is not plotted correctly. The headmodel needs to be driven from mri. You can double check the headmodel, which is standard_bem in your code.
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Helen Wieffering [helen.wieffering at gmail.com<mailto:helen.wieffering at gmail.com>]
Sent: Wednesday, September 16, 2015 10:00 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] Aligning electrodes to template head model

Hi Jia,
Thanks so much for getting back to me. If you have a free moment, would you mind looking over my code? I have tried the tutorial steps many times, even having changed the label of the GSN fiducials to 'Nz', 'LPA', 'RPA',  but seem to keep getting the same incorrect results.

% ALIGN ELECTRODES TO STANDARD_BEM

% read electrode coordinates
elec = ft_read_sens('GSN-HydroCel-129.sfp');

% convert units to mm to match units of headmodel
elec = ft_convert_units(elec, 'mm');

% change label of fiducials
elec.label{1} = 'Nz';
elec.label{2} = 'LPA'
elec.label{3} = 'RPA';

% create fiducial structure
% draw fiducial coordinates from mri
nas = standard_mri.hdr.fiducial.mri.nas;
lpa = standard_mri.hdr.fiducial.mri.lpa;
rpa = standard_mri.hdr.fiducial.mri.rpa;

transm = standard_mri.transform;

nas = ft_warp_apply(transm, nas, 'homogenous');
lpa = ft_warp_apply(transm, lpa, 'homogenous');
rpa = ft_warp_apply(transm, rpa, 'homogenous');

% create a structure similar to a template set of electrodes
fid.chanpos = [nas; lpa; rpa]; % mni-coordinates of fiducials
fid.label = {'Nz','LPA','RPA'}; % same labels as in elec
fid.unit = 'mm'; % same units as mri

% alignment
cfg = [];
cfg.method = 'fiducial';
cfg.template = fid; % see above
cfg.elec = elec;
cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec
elec_aligned = ft_electroderealign(cfg);

% plot to check
figure;
ft_plot_mesh(standard_bem.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]);
hold on;
ft_plot_sens(elec_aligned,'style', 'sk');

For reference, the coordinates I get in the structure fid are the following:
fid =

    chanpos: [3x3 double]
      label: {'Nz'  'LPA'  'RPA'}
       unit: 'mm'

fid.chanpos

ans =

    35   -36     0
   118   -35     0
   -82   -35     0


If those are different from yours, would you let me know? I'm trying to find out at which step I went wrong.
Again, thank you very much!

Best,
Helen


On Mon, Sep 14, 2015 at 11:00 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
Helen,

What a coincident. I'm also working on source analysis on EEG data using GSN HydroCel 128. I had a post a couple weeks ago about later steps. But I did get the alignment to work. The picture you posted looked like the status before the alignment. So i suspect that alignment did not happen.

I'm not sure whether you have noticed it, but the fiducial positions in elec location file were called 'FidNz', 'FidT9', 'FidT10', instead of 'Nz','LPA','RPA' as in the tutorial. So they need to be changed. Then the alignment should work.

best,
-jia

________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Helen Wieffering [helen.wieffering at gmail.com<mailto:helen.wieffering at gmail.com>]
Sent: Monday, September 14, 2015 4:46 PM
To: FieldTrip discussion list
Subject: [FieldTrip] Aligning electrodes to template head model

Hello all,

I have a quick question on aligning electrodes to the standard_bem headmodel, which I downloaded from the FT server.

Namely, are the standard_mri and the standard_bem in the same coordinate system? I assumed this would be so, since one was developed from the other. But when I try to align my electrodes to the standard_bem volume using fiducial positions from the standard_mri, I get very strange results: (image below and attached)

[Inline image 1]

I'm using a GSN HydroCel 128 Cap, and my elec structure contains the fiducial positions relative to the electrodes.
I've been following the tutorial at http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_tutorial_headmodel-5Feeg&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=wNRiA8CLR4Y1ZrEaTkTaIoVaUczL5TYuWIx6FyQDphg&s=LjU77qpw8I7LnSHIEQrNIB0R0YLrutfAEtjjOMjBys0&e=> and would like to follow the steps under 'Automatic Alignment', but as I said: pulling the fiducial positions from the standard_mri seems to not work with the tutorial steps.

Any help is appreciated - thanks in advance!

Helen Wieffering
Bowdoin College

_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=kW18ZarjEMl0kcSTFdA9daM4KYcFZdGymg7wgboAsmc&s=9wDX5VD5t6xGdP84l_wit7DYMhK57vFlE5v1OkxjFgA&e=>


_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=JfxeMzHfEnNZdFBR21r9k2Vo0rxDQSEAQcjBW10-4iY&s=6AKOjV7we5JPrxF8lPj4nFkyJtMSROb0ncfpkjICKU0&e=>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/0cbff169/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unaligned.jpg
Type: image/jpeg
Size: 13372 bytes
Desc: unaligned.jpg
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/0cbff169/attachment.jpg>

From m.goeldi at psychologie.uzh.ch  Thu Sep 17 08:36:34 2015
From: m.goeldi at psychologie.uzh.ch (m.goeldi at psychologie.uzh.ch)
Date: Thu, 17 Sep 2015 08:36:34 +0200
Subject: [FieldTrip] Aligning electrodes to template head model
In-Reply-To: <CAPayXFyY_Y8TQfczehANLdovgiT=ZyNUr2Nqe-gec_+KfFK6=Q@mail.gmail.com>
References: <CAPayXFyY_Y8TQfczehANLdovgiT=ZyNUr2Nqe-gec_+KfFK6=Q@mail.gmail.com>, 
 <CAPayXFwPgwYcafEPnyT404HR52QtuLjMWS5yJ=CJM0U03gYMdQ@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1F914@x10-mbx13.yu.yale.edu>
 <CAPayXFzowWEv1SGcz7=FpsBXX56qA6WFs--tWOPRWf5-tBDTaA@mail.gmail.com>
 <AA21F9F31911364596BE68CA1AAD8DA466E1FB9E@x10-mbx13.yu.yale.edu>
 <CAPayXFwacM8c0kRS2XKZ+y7FAfH86HYX9N0ZMf4Lu3qMSSNgMQ@mail.gmail.com>
Message-ID: <OFF1973E9E.C8345DDF-ONC1257EC3.0023A717-C1257EC3.00244EC6@lotus.uzh.ch>

Hi Helen

I also had problems using the file GSN-HydroCel-129.sfp electrode locations provided in fieldtrip.
I ended up using the file provided in SPM12 (located in '\spm12\EEGtemplates\egi128_GSN_HydroCel.sfp').
This seems to be the same file (it has the same electrodes) but slightly different locations that fit the headmodel much better.

I hope that helps.
Cheers
Maurice


-----fieldtrip-bounces at science.ru.nl schrieb: -----
An: FieldTrip discussion list <fieldtrip at science.ru.nl>
Von: Helen Wieffering 
Gesendet von: fieldtrip-bounces at science.ru.nl
Datum: 17.09.2015 02:28
Betreff: Re: [FieldTrip] Aligning electrodes to template head model

Hi again, Jia,
I agree- something must be going wrong when I plot the head model, or maybe when I warp the fiducial coordinates from the mri, because the alignment is certainly worse off after I complete all the alignment steps than it was originally! But since all my steps draw from the standard_mri and standard_bem, I'm not sure what the problem could be.

My best success has been simply from interactively aligning the electrodes and verifying it visually. I'm attaching a matlab figure of what it looks like just in case anyone has input - I think it looks accurately aligned, but this is my first time creating a head model in field trip so I have limited experience to draw upon.

As always, thanks for your help.

Best,
Helen Wieffering
Bowdoin College

On Wed, Sep 16, 2015 at 3:50 PM, Helen Wieffering <helen.wieffering at gmail.com> wrote:
Hi Jia,
Thanks so much for taking the time to help me. I'll try what you suggested and see how it goes!

Best,
Helen

On Wed, Sep 16, 2015 at 11:59 AM, Wu, Jia <jia.wu at yale.edu> wrote:
     
 
Helen, 
I ran your code and it seemed to work with the mri and headmodel I have. I looked back at the picture you sent originally. It looks like the electrodes were aligned (before alignment, the tip of the head is facing upwards, after alignment with the mri  provided by the wiki it points to the right), but the headmodel is not plotted correctly. The headmodel needs to be driven from mri. You can double check the headmodel, which is standard_bem in  your code. 
-jia
  
  
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helen Wieffering [helen.wieffering at gmail.com]
 Sent: Wednesday, September 16, 2015 10:00 AM
 To: FieldTrip discussion list
 Subject: Re: [FieldTrip] Aligning electrodes to template head model
 
 
 
 
 
 
 
 
 
 
 
Hi Jia,
  Thanks so much for getting back to me. If you have a free moment, would you mind looking over my code? I have tried the tutorial steps many times, even having changed the label of the GSN fiducials to 'Nz', 'LPA', 'RPA',  but seem to keep getting the same incorrect  results.
 
 % ALIGN ELECTRODES TO STANDARD_BEM
 
 % read electrode coordinates
 elec = ft_read_sens('GSN-HydroCel-129.sfp');
 
 % convert units to mm to match units of headmodel
 elec = ft_convert_units(elec, 'mm');
 
 % change label of fiducials
 elec.label{1} = 'Nz';
 elec.label{2} = 'LPA'
 elec.label{3} = 'RPA';
 
 % create fiducial structure
 % draw fiducial coordinates from mri
 nas = standard_mri.hdr.fiducial.mri.nas;
 lpa = standard_mri.hdr.fiducial.mri.lpa;
 rpa = standard_mri.hdr.fiducial.mri.rpa;
  
 transm = standard_mri.transform;
  
 nas = ft_warp_apply(transm, nas, 'homogenous');
 lpa = ft_warp_apply(transm, lpa, 'homogenous');
 rpa = ft_warp_apply(transm, rpa, 'homogenous');
 
 % create a structure similar to a template set of electrodes
 fid.chanpos = [nas; lpa; rpa]; % mni-coordinates of fiducials
 fid.label = {'Nz','LPA','RPA'}; % same labels as in elec 
 fid.unit = 'mm'; % same units as mri
  
 % alignment
 cfg = [];
 cfg.method = 'fiducial';            
 cfg.template = fid; % see above
 cfg.elec = elec;
 cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec
 elec_aligned = ft_electroderealign(cfg);
 
 % plot to check
 figure;
 ft_plot_mesh(standard_bem.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); 
 hold on;
 ft_plot_sens(elec_aligned,'style', 'sk');
 
  For reference, the coordinates I get in the structure fid are the following:
 fid = 
 
     chanpos: [3x3 double]
       label: {'Nz'  'LPA'  'RPA'}
        unit: 'mm'
 
 fid.chanpos
 
 ans =
 
     35   -36     0
    118   -35     0
    -82   -35     0
 
 
  If those are different from yours, would you let me know? I'm trying to find out at which step I went wrong. 
  Again, thank you very much!
 
  Best,
  Helen
 
 
 
 
 

       

 
On Mon, Sep 14, 2015 at 11:00 PM, Wu, Jia  <jia.wu at yale.edu> wrote:
  
 
Helen, 

 
What a coincident. I'm also working on source analysis on EEG data using GSN HydroCel 128. I had a post a couple weeks ago about later steps. But I did get the alignment to work. The picture you posted looked like the status before the alignment. So i  suspect that alignment did not happen.  

  
I'm not sure whether you have noticed it, but the fiducial positions in elec location file were called 'FidNz', 'FidT9', 'FidT10', instead of 'Nz','LPA','RPA'  as in the tutorial. So they need to be changed. Then the alignment should work. 

  
best, 
-jia 

 
  
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helen Wieffering [helen.wieffering at gmail.com]
 Sent: Monday, September 14, 2015 4:46 PM
 To: FieldTrip discussion list
 Subject: [FieldTrip] Aligning electrodes to template head model
 
  
 
 
 
 
 
 
 
Hello all,
 
  I have a quick question on aligning electrodes to the standard_bem headmodel, which I downloaded from the FT server. 
 
  
Namely, are the standard_mri and the standard_bem in the same coordinate system? I assumed this would be so, since one was developed from the other. But when I try to align my electrodes to the standard_bem volume using fiducial positions from the standard_mri,  I get very strange results: (image below and attached)
 
 �
 
 I'm using a GSN HydroCel 128 Cap, and my elec structure contains the fiducial positions relative to the electrodes. 
 I've been following the tutorial at  http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg and would like to follow the steps under 'Automatic Alignment', but as I said: pulling the fiducial positions from the standard_mri seems to not work with the tutorial steps.
  
  Any help is appreciated - thanks in advance!
 
 

  
Helen Wieffering
  
Bowdoin College
            
 _______________________________________________
 fieldtrip mailing list
 fieldtrip at donders.ru.nl
 http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
   
        
_______________________________________________
 fieldtrip mailing list
 fieldtrip at donders.ru.nl
 http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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

[Anhang 'head model.fig' entfernt von Maurice G�ldi/at/UZH]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/7c781b04/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image.ii_14fcd98ad69b9786.jpg
Type: image/jpeg
Size: 13372 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/7c781b04/attachment.jpg>

From darinkat87 at gmail.com  Thu Sep 17 09:43:49 2015
From: darinkat87 at gmail.com (=?UTF-8?Q?Darinka_Tr=C3=BCbutschek?=)
Date: Thu, 17 Sep 2015 09:43:49 +0200
Subject: [FieldTrip] Neighbors for Elekta Neuromag 306 gradiometers
	separately?
Message-ID: <CAB8a2eJSvgt_MxU9JF4cqX0ML+QP7UWn3-Y7sL_3SnKFBCmdfQ@mail.gmail.com>

Dear Fieldtrip community,

I am new to MEG/fieldtrip and have a question regarding the neighbor
structure necessary for computing cluster-based statistics. I am currently
analyzing data from a Neuromag 306 system (with 102 Mags and 204 Grads) and
would like to look separately at Mags, Grad1, and Grad2.
I assume that this means that I also need to compute the neighbors
separately for the different channel types.

My question therefore concerns fieldtrip's standard neighbor templates for
Neuromag. Is there a specific reason (theoretical or methodological), why
there are no separate templates for Grad1 and 2? All that I could find are
separate templates for Mag (neuromag306mag_neighb.mat), the combined planar
gradients (neuromag306cmb_neighb.mat), and the neuromag306planar_neighb.mat
template, which, if I understand correctly, does not combine the Grads, but
still lists sensors of one type as neighbors of sensors of another type
(e.g., for sensor 0713 - a gradiometer measuring the derivative along the
longitudinal component, the neighbors listed include 0432, 0723, but also
sensors that, if I interpret it correctly, should measure the derivative
along the latitudinal component, such as 0433, 0712, etc.) Is there a
specific reason, why sometimes, for a given sensor position, both Grad1 and
Grad2 are included in the neighbors (e.g., 0432 and 0433), but sometimes
only one of the two (e.g., 0742)?

Many thanks in advance for your help!

Best,
Darinka
-- 
Darinka Trübutschek (PhD Candidate)

Inserm-CEA Cognitive Neuroimaging Unit
CEA/SAC/DSV/DRM/Neurospin
Bât 145, Point Courier 156
F-91191 Gif-sur-Yvette

website: https://sites.google.com/site/dtruebutschek/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/40b4d075/attachment.htm>

From s.aurtenetxe at bcbl.eu  Thu Sep 17 10:09:11 2015
From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe)
Date: Thu, 17 Sep 2015 10:09:11 +0200 (CEST)
Subject: [FieldTrip] Leadfield of one condition with two different
 'grad' structures
In-Reply-To: <7FEF33B7-4B83-4206-8A8D-92988F50AE64@psi.ucm.es>
References: <941858791.92311.1442409704382.JavaMail.zimbra@bcbl.eu>
 <7FEF33B7-4B83-4206-8A8D-92988F50AE64@psi.ucm.es>
Message-ID: <513570832.104914.1442477351857.JavaMail.zimbra@bcbl.eu>

Dear Stephan, 

Thank you for your rapid answer. 

Indeed, I did measure the coils position. 
This approach seems the most suitable one so 
I will follow it and see how the results look like. 

Thank you!
Best,

Sara




Sara Aurtenetxe

----- Original Message -----
From: "smoratti" <smoratti at psi.ucm.es>
To: "FieldTrip discussion list" <fieldtrip at science.ru.nl>
Cc: "Sara Aurtenetxe" <s.aurtenetxe at bcbl.eu>
Sent: Wednesday, September 16, 2015 3:57:30 PM
Subject: Re: [FieldTrip] Leadfield of one condition with two different 'grad' structures

Dear Sara,

Did you measure for each run the HPC coil position in order to determine the relative sensor position with respect to the head? If so, you could calculate the lead field for each run separately, source localize for each run and then collapse the runs after source localization.

Best,

Stephan


________________________________________________________
Stephan Moratti, PhD

see: Stephan's research profile

Universidad Complutense de Madrid
Facultad de Psicología
Departamento de Psicología Básica I
Campus de Somosaguas
Despacho (Office) 1326-0 
28223 Pozuelo de Alarcón (Madrid)
Spain

and

Center for Biomedical Technology
Laboratory for Cognitive and Computational Neuroscience
Parque Científico y Tecnológico de la Universidad Politecnica de Madrid
Campus Montegancedo
28223 Pozuelo de Alarcón (Madrid)
Spain


email: smoratti at psi.ucm.es
Tel.:    +34 679219982

El 16/09/2015, a las 15:21, Sara Aurtenetxe escribió:

> Dear all, 
> 
> I would appreciate to get some advice on the following.
> 
> I am computing the leadfield (ft_prepare_leadfield) for the subsequent source analysis (ft_sourceanalysis) of ERF data acquired with Elekta Neuromag system. 
> My experiment is acquired in a unique run, including 3 randomized conditions for each participant normally. 
> Therefore, the unique 'cfg.grad' structure is used for the leadfield computation of each participant.
> 
> However, due to a must, the experiment was recorded into two independent runs (splited) for one of the participants. Here comes the issue: 
> Given that the 'grad' structure is specific to each run, this participant turns to with two different 'grad' structures for the same condition.
> 
> My question is: which is the most suitable approach to compute the leadfield of one condition when the data comes from two different runs, so when having two different 'grad' structures?
> 
> I would say that I should compute the leadfield and the sourceanalysis for each run and condition separately, and then join the solutions of the same condition. 
> But I wonder if this is a correct approach and/or if there is any additional/more appropriate approach for that. 
> 
> Any comment will be very appreciated.
> 
> Thank you in advance.
> Best,
> 
> Sara
> 
> 
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



From RICHARDS at mailbox.sc.edu  Thu Sep 17 15:15:28 2015
From: RICHARDS at mailbox.sc.edu (RICHARDS, JOHN)
Date: Thu, 17 Sep 2015 13:15:28 +0000
Subject: [FieldTrip] Aligning electrodes to template head model (Wu, Jia)
Message-ID: <48CA849C-E308-4CB7-B7C8-2E31A25716AE@mailbox.sc.edu>

If you need the standard model for some particular reason, the next part won’t help, but..

I have a database of average MRI templates (head or brain) for “20-24Year olds”, with segmented heads (e.g., 4 BEM compartments; or segmented for FEM), and average electrode positions.  The average electrode positions are for the GSN or H-GSN and come from an electrode placement study with about 140 participants; I also have “virtual 10-10” positions.  The electrode positions are already on the head surface so that “warping/transforming” is unnecessary, and if the head fiducials match the electrode fiducials the FT fit is perfect because the electrodes are already on the scalp.  I have used the AC/PC/LPA/RPA alignment successfully.  Also, there are stereotaxic atlases in the same format as the average MRI templates.  I have managed for myself to get all these working in FT (spherical, BEM-CP, BEM-Dipoli, FEM-SImBio, and atlases with ROIs).

And, re average MRI templates, I have them for ages 4 through adults in steps of two years; with electrodes, segmented heads (and priors), atlases, etc.  

See me www site for publications on the database (e.g., Richards, Sanchez et al, 2015), electrodes (Richards, Boswell et al, 2015), and atlases (for infants; Fillmore et al., 2015, Dev Neuroscience).  I also am working on several papers that use FT for the source analysis.

John

***********************************************
John E. Richards Carolina Distinguished Professor
Department of Psychology
University of South Carolina
Columbia, SC  29208
Dept Phone: 803 777 2079
Fax: 803 777 9558
Email: richards-john at sc.edu
HTTP: jerlab.psych.sc.edu
***********************************************










On 9/17/15, 4:00 AM, "fieldtrip-bounces at science.ru.nl on behalf of fieldtrip-request at science.ru.nl" <fieldtrip-bounces at science.ru.nl on behalf of 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
>	http://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: Aligning electrodes to template head model (Wu, Jia)
>   2. Re: Aligning electrodes to template head model
>      (m.goeldi at psychologie.uzh.ch)
>   3. Neighbors for Elekta Neuromag 306 gradiometers	separately?
>      (Darinka Tr?butschek)
>   4. Re: Leadfield of one condition with two different 'grad'
>      structures (Sara Aurtenetxe)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Thu, 17 Sep 2015 02:13:57 +0000
>From: "Wu, Jia" <jia.wu at yale.edu>
>To: FieldTrip discussion list <fieldtrip at science.ru.nl>
>Subject: Re: [FieldTrip] Aligning electrodes to template head model
>Message-ID:
>	<AA21F9F31911364596BE68CA1AAD8DA466E1FC44 at x10-mbx13.yu.yale.edu>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Helen,
>Can you find the place where you downloaded the headmodel?
>-jia
>________________________________
>From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helen Wieffering [helen.wieffering at gmail.com]
>Sent: Wednesday, September 16, 2015 8:20 PM
>To: FieldTrip discussion list
>Subject: Re: [FieldTrip] Aligning electrodes to template head model
>
>Hi again, Jia,
>I agree- something must be going wrong when I plot the head model, or maybe when I warp the fiducial coordinates from the mri, because the alignment is certainly worse off after I complete all the alignment steps than it was originally! But since all my steps draw from the standard_mri and standard_bem, I'm not sure what the problem could be.
>
>My best success has been simply from interactively aligning the electrodes and verifying it visually. I'm attaching a matlab figure of what it looks like just in case anyone has input - I think it looks accurately aligned, but this is my first time creating a head model in field trip so I have limited experience to draw upon.
>
>As always, thanks for your help.
>
>Best,
>Helen Wieffering
>Bowdoin College
>
>On Wed, Sep 16, 2015 at 3:50 PM, Helen Wieffering <helen.wieffering at gmail.com<mailto:helen.wieffering at gmail.com>> wrote:
>Hi Jia,
>Thanks so much for taking the time to help me. I'll try what you suggested and see how it goes!
>
>Best,
>Helen
>
>On Wed, Sep 16, 2015 at 11:59 AM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
>Helen,
>I ran your code and it seemed to work with the mri and headmodel I have. I looked back at the picture you sent originally. It looks like the electrodes were aligned (before alignment, the tip of the head is facing upwards, after alignment with the mri provided by the wiki it points to the right), but the headmodel is not plotted correctly. The headmodel needs to be driven from mri. You can double check the headmodel, which is standard_bem in your code.
>-jia
>________________________________
>From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Helen Wieffering [helen.wieffering at gmail.com<mailto:helen.wieffering at gmail.com>]
>Sent: Wednesday, September 16, 2015 10:00 AM
>To: FieldTrip discussion list
>Subject: Re: [FieldTrip] Aligning electrodes to template head model
>
>Hi Jia,
>Thanks so much for getting back to me. If you have a free moment, would you mind looking over my code? I have tried the tutorial steps many times, even having changed the label of the GSN fiducials to 'Nz', 'LPA', 'RPA',  but seem to keep getting the same incorrect results.
>
>% ALIGN ELECTRODES TO STANDARD_BEM
>
>% read electrode coordinates
>elec = ft_read_sens('GSN-HydroCel-129.sfp');
>
>% convert units to mm to match units of headmodel
>elec = ft_convert_units(elec, 'mm');
>
>% change label of fiducials
>elec.label{1} = 'Nz';
>elec.label{2} = 'LPA'
>elec.label{3} = 'RPA';
>
>% create fiducial structure
>% draw fiducial coordinates from mri
>nas = standard_mri.hdr.fiducial.mri.nas;
>lpa = standard_mri.hdr.fiducial.mri.lpa;
>rpa = standard_mri.hdr.fiducial.mri.rpa;
>
>transm = standard_mri.transform;
>
>nas = ft_warp_apply(transm, nas, 'homogenous');
>lpa = ft_warp_apply(transm, lpa, 'homogenous');
>rpa = ft_warp_apply(transm, rpa, 'homogenous');
>
>% create a structure similar to a template set of electrodes
>fid.chanpos = [nas; lpa; rpa]; % mni-coordinates of fiducials
>fid.label = {'Nz','LPA','RPA'}; % same labels as in elec
>fid.unit = 'mm'; % same units as mri
>
>% alignment
>cfg = [];
>cfg.method = 'fiducial';
>cfg.template = fid; % see above
>cfg.elec = elec;
>cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec
>elec_aligned = ft_electroderealign(cfg);
>
>% plot to check
>figure;
>ft_plot_mesh(standard_bem.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]);
>hold on;
>ft_plot_sens(elec_aligned,'style', 'sk');
>
>For reference, the coordinates I get in the structure fid are the following:
>fid =
>
>    chanpos: [3x3 double]
>      label: {'Nz'  'LPA'  'RPA'}
>       unit: 'mm'
>
>fid.chanpos
>
>ans =
>
>    35   -36     0
>   118   -35     0
>   -82   -35     0
>
>
>If those are different from yours, would you let me know? I'm trying to find out at which step I went wrong.
>Again, thank you very much!
>
>Best,
>Helen
>
>
>On Mon, Sep 14, 2015 at 11:00 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:
>Helen,
>
>What a coincident. I'm also working on source analysis on EEG data using GSN HydroCel 128. I had a post a couple weeks ago about later steps. But I did get the alignment to work. The picture you posted looked like the status before the alignment. So i suspect that alignment did not happen.
>
>I'm not sure whether you have noticed it, but the fiducial positions in elec location file were called 'FidNz', 'FidT9', 'FidT10', instead of 'Nz','LPA','RPA' as in the tutorial. So they need to be changed. Then the alignment should work.
>
>best,
>-jia
>
>________________________________
>From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Helen Wieffering [helen.wieffering at gmail.com<mailto:helen.wieffering at gmail.com>]
>Sent: Monday, September 14, 2015 4:46 PM
>To: FieldTrip discussion list
>Subject: [FieldTrip] Aligning electrodes to template head model
>
>Hello all,
>
>I have a quick question on aligning electrodes to the standard_bem headmodel, which I downloaded from the FT server.
>
>Namely, are the standard_mri and the standard_bem in the same coordinate system? I assumed this would be so, since one was developed from the other. But when I try to align my electrodes to the standard_bem volume using fiducial positions from the standard_mri, I get very strange results: (image below and attached)
>
>[Inline image 1]
>
>I'm using a GSN HydroCel 128 Cap, and my elec structure contains the fiducial positions relative to the electrodes.
>I've been following the tutorial at http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_tutorial_headmodel-5Feeg&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=wNRiA8CLR4Y1ZrEaTkTaIoVaUczL5TYuWIx6FyQDphg&s=LjU77qpw8I7LnSHIEQrNIB0R0YLrutfAEtjjOMjBys0&e=> and would like to follow the steps under 'Automatic Alignment', but as I said: pulling the fiducial positions from the standard_mri seems to not work with the tutorial steps.
>
>Any help is appreciated - thanks in advance!
>
>Helen Wieffering
>Bowdoin College
>
>_______________________________________________
>fieldtrip mailing list
>fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=kW18ZarjEMl0kcSTFdA9daM4KYcFZdGymg7wgboAsmc&s=9wDX5VD5t6xGdP84l_wit7DYMhK57vFlE5v1OkxjFgA&e=>
>
>
>_______________________________________________
>fieldtrip mailing list
>fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=JfxeMzHfEnNZdFBR21r9k2Vo0rxDQSEAQcjBW10-4iY&s=6AKOjV7we5JPrxF8lPj4nFkyJtMSROb0ncfpkjICKU0&e=>
>
>
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/0cbff169/attachment-0001.html>
>-------------- next part --------------
>A non-text attachment was scrubbed...
>Name: unaligned.jpg
>Type: image/jpeg
>Size: 13372 bytes
>Desc: unaligned.jpg
>URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/0cbff169/attachment-0001.jpg>
>
>------------------------------
>
>Message: 2
>Date: Thu, 17 Sep 2015 08:36:34 +0200
>From: m.goeldi at psychologie.uzh.ch
>To: FieldTrip discussion list <fieldtrip at science.ru.nl>
>Subject: Re: [FieldTrip] Aligning electrodes to template head model
>Message-ID:
>	<OFF1973E9E.C8345DDF-ONC1257EC3.0023A717-C1257EC3.00244EC6 at lotus.uzh.ch>
>	
>Content-Type: text/plain; charset="utf-8"
>
>Hi Helen
>
>I also had problems using the file GSN-HydroCel-129.sfp electrode locations provided in fieldtrip.
>I ended up using the file provided in SPM12 (located in '\spm12\EEGtemplates\egi128_GSN_HydroCel.sfp').
>This seems to be the same file (it has the same electrodes) but slightly different locations that fit the headmodel much better.
>
>I hope that helps.
>Cheers
>Maurice
>
>
>-----fieldtrip-bounces at science.ru.nl schrieb: -----
>An: FieldTrip discussion list <fieldtrip at science.ru.nl>
>Von: Helen Wieffering 
>Gesendet von: fieldtrip-bounces at science.ru.nl
>Datum: 17.09.2015 02:28
>Betreff: Re: [FieldTrip] Aligning electrodes to template head model
>
>Hi again, Jia,
>I agree- something must be going wrong when I plot the head model, or maybe when I warp the fiducial coordinates from the mri, because the alignment is certainly worse off after I complete all the alignment steps than it was originally! But since all my steps draw from the standard_mri and standard_bem, I'm not sure what the problem could be.
>
>My best success has been simply from interactively aligning the electrodes and verifying it visually. I'm attaching a matlab figure of what it looks like just in case anyone has input - I think it looks accurately aligned, but this is my first time creating a head model in field trip so I have limited experience to draw upon.
>
>As always, thanks for your help.
>
>Best,
>Helen Wieffering
>Bowdoin College
>
>On Wed, Sep 16, 2015 at 3:50 PM, Helen Wieffering <helen.wieffering at gmail.com> wrote:
>Hi Jia,
>Thanks so much for taking the time to help me. I'll try what you suggested and see how it goes!
>
>Best,
>Helen
>
>On Wed, Sep 16, 2015 at 11:59 AM, Wu, Jia <jia.wu at yale.edu> wrote:
>     
> 
>Helen, 
>I ran your code and it seemed to work with the mri and headmodel I have. I looked back at the picture you sent originally. It looks like the electrodes were aligned (before alignment, the tip of the head is facing upwards, after alignment with the mri  provided by the wiki it points to the right), but the headmodel is not plotted correctly. The headmodel needs to be driven from mri. You can double check the headmodel, which is?standard_bem in  your code. 
>-jia
>  
>  
>From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helen Wieffering [helen.wieffering at gmail.com]
> Sent: Wednesday, September 16, 2015 10:00 AM
> To: FieldTrip discussion list
> Subject: Re: [FieldTrip] Aligning electrodes to template head model
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>Hi Jia,
>  Thanks so much for getting back to me. If you have a free moment, would you mind looking over my code? I have tried the tutorial steps many times, even having changed the label of the GSN fiducials to 'Nz', 'LPA', 'RPA',? but seem to keep getting the same incorrect  results.
> 
> % ALIGN ELECTRODES TO STANDARD_BEM
> 
> % read electrode coordinates
> elec = ft_read_sens('GSN-HydroCel-129.sfp');
> 
> % convert units to mm to match units of headmodel
> elec = ft_convert_units(elec, 'mm');
> 
> % change label of fiducials
> elec.label{1} = 'Nz';
> elec.label{2} = 'LPA'
> elec.label{3} = 'RPA';
> 
> % create fiducial structure
> % draw fiducial coordinates from mri
> nas = standard_mri.hdr.fiducial.mri.nas;
> lpa = standard_mri.hdr.fiducial.mri.lpa;
> rpa = standard_mri.hdr.fiducial.mri.rpa;
> ?
> transm = standard_mri.transform;
> ?
> nas = ft_warp_apply(transm, nas, 'homogenous');
> lpa = ft_warp_apply(transm, lpa, 'homogenous');
> rpa = ft_warp_apply(transm, rpa, 'homogenous');
> 
> % create a structure similar to a template set of electrodes
> fid.chanpos = [nas; lpa; rpa]; % mni-coordinates of fiducials
> fid.label = {'Nz','LPA','RPA'}; % same labels as in elec 
> fid.unit = 'mm'; % same units as mri
> ?
> % alignment
> cfg = [];
> cfg.method = 'fiducial';??????????? 
> cfg.template = fid; % see above
> cfg.elec = elec;
> cfg.fiducial = {'Nz', 'LPA', 'RPA'}; % labels of fiducials in fid and in elec
> elec_aligned = ft_electroderealign(cfg);
> 
> % plot to check
> figure;
> ft_plot_mesh(standard_bem.bnd(1), 'edgecolor','none','facealpha',0.8,'facecolor',[0.6 0.6 0.8]); 
> hold on;
> ft_plot_sens(elec_aligned,'style', 'sk');
> 
>  For reference, the coordinates I get in the structure fid are the following:
> fid = 
> 
> ??? chanpos: [3x3 double]
> ????? label: {'Nz'? 'LPA'? 'RPA'}
> ?????? unit: 'mm'
> 
> fid.chanpos
> 
> ans =
> 
> ??? 35?? -36???? 0
> ?? 118?? -35???? 0
> ?? -82?? -35???? 0
> 
> 
>  If those are different from yours, would you let me know? I'm trying to find out at which step I went wrong. 
>  Again, thank you very much!
> 
>  Best,
>  Helen
> 
> 
> 
> 
> 
>
>       
>
> 
>On Mon, Sep 14, 2015 at 11:00 PM, Wu, Jia  <jia.wu at yale.edu> wrote:
>  
> 
>Helen, 
>
> 
>What a coincident. I'm also working on source analysis on EEG data using GSN HydroCel 128. I had a post a couple weeks ago about later steps. But I did get the alignment to work. The picture you posted looked like the status before the alignment. So i  suspect that alignment did not happen.? 
>
>  
>I'm not sure whether you have noticed it, but the fiducial positions in elec location file were called 'FidNz', 'FidT9', 'FidT10', instead of?'Nz','LPA','RPA'  as in the tutorial. So they need to be changed. Then the alignment should work. 
>
>  
>best, 
>-jia 
>
> 
>  
>From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helen Wieffering [helen.wieffering at gmail.com]
> Sent: Monday, September 14, 2015 4:46 PM
> To: FieldTrip discussion list
> Subject: [FieldTrip] Aligning electrodes to template head model
> 
>  
> 
> 
> 
> 
> 
> 
> 
>Hello all,
> 
>  I have a quick question on aligning electrodes to the standard_bem headmodel, which I downloaded from the FT server. 
> 
>  
>Namely, are the standard_mri and the standard_bem in the same coordinate system? I assumed this would be so, since one was developed from the other. But when I try to align my electrodes to the standard_bem volume using fiducial positions from the standard_mri,  I get very strange results: (image below and attached)
> 
> ?
> 
> I'm using a GSN HydroCel 128 Cap, and my elec structure contains the fiducial positions relative to the electrodes. 
> I've been following the tutorial at  http://www.fieldtriptoolbox.org/tutorial/headmodel_eeg and would like to follow the steps under 'Automatic Alignment', but as I said: pulling the fiducial positions from the standard_mri seems to not work with the tutorial steps.
>  
>  Any help is appreciated - thanks in advance!
> 
> 
>
>  
>Helen Wieffering
>  
>Bowdoin College
>            
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>   
>        
>_______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> 
> 
>_______________________________________________
>fieldtrip mailing list
>fieldtrip at donders.ru.nl
>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>[Anhang 'head model.fig' entfernt von Maurice G?ldi/at/UZH]
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/7c781b04/attachment-0001.html>
>-------------- next part --------------
>A non-text attachment was scrubbed...
>Name: Image.ii_14fcd98ad69b9786.jpg
>Type: image/jpeg
>Size: 13372 bytes
>Desc: not available
>URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/7c781b04/attachment-0001.jpg>
>
>------------------------------
>
>Message: 3
>Date: Thu, 17 Sep 2015 09:43:49 +0200
>From: Darinka Tr?butschek <darinkat87 at gmail.com>
>To: fieldtrip at science.ru.nl
>Subject: [FieldTrip] Neighbors for Elekta Neuromag 306 gradiometers
>	separately?
>Message-ID:
>	<CAB8a2eJSvgt_MxU9JF4cqX0ML+QP7UWn3-Y7sL_3SnKFBCmdfQ at mail.gmail.com>
>Content-Type: text/plain; charset="utf-8"
>
>Dear Fieldtrip community,
>
>I am new to MEG/fieldtrip and have a question regarding the neighbor
>structure necessary for computing cluster-based statistics. I am currently
>analyzing data from a Neuromag 306 system (with 102 Mags and 204 Grads) and
>would like to look separately at Mags, Grad1, and Grad2.
>I assume that this means that I also need to compute the neighbors
>separately for the different channel types.
>
>My question therefore concerns fieldtrip's standard neighbor templates for
>Neuromag. Is there a specific reason (theoretical or methodological), why
>there are no separate templates for Grad1 and 2? All that I could find are
>separate templates for Mag (neuromag306mag_neighb.mat), the combined planar
>gradients (neuromag306cmb_neighb.mat), and the neuromag306planar_neighb.mat
>template, which, if I understand correctly, does not combine the Grads, but
>still lists sensors of one type as neighbors of sensors of another type
>(e.g., for sensor 0713 - a gradiometer measuring the derivative along the
>longitudinal component, the neighbors listed include 0432, 0723, but also
>sensors that, if I interpret it correctly, should measure the derivative
>along the latitudinal component, such as 0433, 0712, etc.) Is there a
>specific reason, why sometimes, for a given sensor position, both Grad1 and
>Grad2 are included in the neighbors (e.g., 0432 and 0433), but sometimes
>only one of the two (e.g., 0742)?
>
>Many thanks in advance for your help!
>
>Best,
>Darinka
>-- 
>Darinka Tr?butschek (PhD Candidate)
>
>Inserm-CEA Cognitive Neuroimaging Unit
>CEA/SAC/DSV/DRM/Neurospin
>B?t 145, Point Courier 156
>F-91191 Gif-sur-Yvette
>
>website: https://sites.google.com/site/dtruebutschek/
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/40b4d075/attachment-0001.html>
>
>------------------------------
>
>Message: 4
>Date: Thu, 17 Sep 2015 10:09:11 +0200 (CEST)
>From: Sara Aurtenetxe <s.aurtenetxe at bcbl.eu>
>To: smoratti <smoratti at psi.ucm.es>
>Cc: FieldTrip discussion list <fieldtrip at science.ru.nl>
>Subject: Re: [FieldTrip] Leadfield of one condition with two different
>	'grad' structures
>Message-ID: <513570832.104914.1442477351857.JavaMail.zimbra at bcbl.eu>
>Content-Type: text/plain; charset=utf-8
>
>Dear Stephan, 
>
>Thank you for your rapid answer. 
>
>Indeed, I did measure the coils position. 
>This approach seems the most suitable one so 
>I will follow it and see how the results look like. 
>
>Thank you!
>Best,
>
>Sara
>
>
>
>
>Sara Aurtenetxe
>
>----- Original Message -----
>From: "smoratti" <smoratti at psi.ucm.es>
>To: "FieldTrip discussion list" <fieldtrip at science.ru.nl>
>Cc: "Sara Aurtenetxe" <s.aurtenetxe at bcbl.eu>
>Sent: Wednesday, September 16, 2015 3:57:30 PM
>Subject: Re: [FieldTrip] Leadfield of one condition with two different 'grad' structures
>
>Dear Sara,
>
>Did you measure for each run the HPC coil position in order to determine the relative sensor position with respect to the head? If so, you could calculate the lead field for each run separately, source localize for each run and then collapse the runs after source localization.
>
>Best,
>
>Stephan
>
>
>________________________________________________________
>Stephan Moratti, PhD
>
>see: Stephan's research profile
>
>Universidad Complutense de Madrid
>Facultad de Psicolog?a
>Departamento de Psicolog?a B?sica I
>Campus de Somosaguas
>Despacho (Office) 1326-0 
>28223 Pozuelo de Alarc?n (Madrid)
>Spain
>
>and
>
>Center for Biomedical Technology
>Laboratory for Cognitive and Computational Neuroscience
>Parque Cient?fico y Tecnol?gico de la Universidad Politecnica de Madrid
>Campus Montegancedo
>28223 Pozuelo de Alarc?n (Madrid)
>Spain
>
>
>email: smoratti at psi.ucm.es
>Tel.:    +34 679219982
>
>El 16/09/2015, a las 15:21, Sara Aurtenetxe escribi?:
>
>> Dear all, 
>> 
>> I would appreciate to get some advice on the following.
>> 
>> I am computing the leadfield (ft_prepare_leadfield) for the subsequent source analysis (ft_sourceanalysis) of ERF data acquired with Elekta Neuromag system. 
>> My experiment is acquired in a unique run, including 3 randomized conditions for each participant normally. 
>> Therefore, the unique 'cfg.grad' structure is used for the leadfield computation of each participant.
>> 
>> However, due to a must, the experiment was recorded into two independent runs (splited) for one of the participants. Here comes the issue: 
>> Given that the 'grad' structure is specific to each run, this participant turns to with two different 'grad' structures for the same condition.
>> 
>> My question is: which is the most suitable approach to compute the leadfield of one condition when the data comes from two different runs, so when having two different 'grad' structures?
>> 
>> I would say that I should compute the leadfield and the sourceanalysis for each run and condition separately, and then join the solutions of the same condition. 
>> But I wonder if this is a correct approach and/or if there is any additional/more appropriate approach for that. 
>> 
>> Any comment will be very appreciated.
>> 
>> Thank you in advance.
>> Best,
>> 
>> Sara
>> 
>> 
>> 
>> 
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
>------------------------------
>
>_______________________________________________
>fieldtrip mailing list
>fieldtrip at donders.ru.nl
>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>End of fieldtrip Digest, Vol 58, Issue 17
>*****************************************



From ma447 at leicester.ac.uk  Thu Sep 17 22:18:55 2015
From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.))
Date: Thu, 17 Sep 2015 20:18:55 +0000
Subject: [FieldTrip] Gratton & Coles ocular artifacts removing
Message-ID: <05F556AD0303584F8A24EE56D63FEE272B6FA128@exp-dag1-n2.uol.le.ac.uk>

Dear Fieldtrip community,

I am looking for a matlab code for Gratton & Coles ocular artifacts removing.
I want to use the code without calling fieldtrip commands.
Any help would be appriciated.

Thanks,
Maryam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150917/4f559bb4/attachment.htm>

From jorn at artinis.com  Fri Sep 18 10:12:25 2015
From: jorn at artinis.com (=?UTF-8?Q?J=C3=B6rn_M._Horschig?=)
Date: Fri, 18 Sep 2015 10:12:25 +0200
Subject: [FieldTrip] Problem with ft_megrealign
In-Reply-To: <CADcxnnNDRP_DYQGq+uEeqKJVvVd+AEzXNszbPwc1LWC13wqJjw@mail.gmail.com>
References: <CADcxnnOuyYNG_X=zcZoEGH0yPnb=mqpNgEK_C0UvyYaJQYvT0A@mail.gmail.com>
 <007801d0eba6$10816b80$31844280$@artinis.com>
 <CADcxnnNDRP_DYQGq+uEeqKJVvVd+AEzXNszbPwc1LWC13wqJjw@mail.gmail.com>
Message-ID: <020101d0f1e9$c0dbab00$42930100$@artinis.com>

Dear Daria,

 

have you tried the most recent version of FT? This should have been resolved there.

 

Best,

Jörn

 

--

 

Jörn M. Horschig, PhD, Software Engineer

 <http://www.artinis.com/> Artinis Medical Systems  |  +31 481 350 980 

 

From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Daria Laptinskaya
Sent: Tuesday, September 15, 2015 11:36 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] Problem with ft_megrealign

 

Dear Jörn,

 

thank you very much for your helpful answer! I did not want to answer before running the function. First I got an error message with the notice that separate structures of the cfg.template could not be translated into a variable of the type double (template variable).  Hence I defined the template variable as a cell-array: 

Ntemplate = length(cfg.template);

template = cell(Ntemplate, 1);

 

and at the end did this: 

j = 1;

for i=1:length(template)

    

    eval(['tp', num2str(j), ' = template{1};'])    

 

    j = j+1;

end

template_new = ([tp1, tp2]);

grad = ft_average_sens(template_new);

 

Now it works fine, then I leave out the cfg.headshape = ‘hs_file’.  Using this command is leading to the following error message: Reference to non-existent field 'xgrid'. I understand the message, but could not fix the problem till now. I could swear, it worked some time ago :). 

I’m sorry to bother you with this, but I would appreciate, if you or someone else could give me a further tip, how to solve the problem.

Many thank in advance!

 

Best, 

Daria

 

2015-09-10 10:52 GMT+02:00 Jörn M. Horschig <jorn at artinis.com <mailto:jorn at artinis.com> >:

Dear Daria,

 

try initializing tp_avg just before the for-loop, e.g. by set tp_avg = []

 

The error message you got means that you have a function called template somewhere in your path. In the command line, you can type 

>> which template

to find out where function is located. Afaik it’s not a FieldTrip function.  Anyway, to fix this, the template variable should have been initialized in the same vein as I described above. I’ll quickly fix this so that this does not happen anymore in the new version (from tomorrow onwards). 

This means, also for you the fix would have been just to initialize the template variable rather than renaming the variable, but your solution also works fine after initializing the variable ;)

 

Best,

Jörn

 

 

 

--

 

Jörn M. Horschig, PhD, Software Engineer

 <http://www.artinis.com/> Artinis Medical Systems  |  +31 481 350 980 <tel:%2B31%20481%20350%20980>  

 

From: fieldtrip-bounces at science.ru.nl <mailto:fieldtrip-bounces at science.ru.nl>  [mailto:fieldtrip-bounces at science.ru.nl <mailto:fieldtrip-bounces at science.ru.nl> ] On Behalf Of Daria Laptinskaya
Sent: Thursday, September 10, 2015 10:39 AM
To: FieldTrip discussion list <fieldtrip at science.ru.nl <mailto:fieldtrip at science.ru.nl> >
Subject: [FieldTrip] Problem with ft_megrealign

 

Dear all,

I would like to apply the ft_megrealign function to MEG data.

First I tried this: 

    cfg             = [];

    cfg.vol.r       = 12;

    cfg.vol.o       = [0, 0, 4];

    cfg.template    = allsens;

    cfg.channel     = {'MEG'};

    cfg.inwardshift =  1;

    cfg.headshape   = 'hs_file';

 

new_data = ft_megrealign(cfg, old_data);

 

Then I got the following error message:

At compilation, "template" was determined to be a variable and this variable is
uninitialized. "template" is also a function name and previous versions of MATLAB would
have called the function. However, MATLAB 7 forbids the use of the same name in the same
context as both a function and a variable.

 

I thought that renaming the variable “template” would solve the problem and did the following within the original function (replaced the template-variable with the Ntp_avg variable):

 

Ntp_avg = length(cfg.template);

for i=1:Ntp_avg

  if ischar(cfg.template{i}),

    fprintf('reading template sensor position from %s\n', cfg.template{i});

    tp_avg(i) = ft_read_sens(cfg.template{i});

  elseif isstruct(cfg.template{i}) && isfield(cfg.template{i}, 'coilpos') && isfield(cfg.template{i}, 'coilori') && isfield(cfg.template{i}, 'tra'),

    tp_avg(i) = cfg.template{i};

  end

end

 

No I get an error message, that “the variable tp_avg is not defined”.

Do I forget something? Or do anyone have an other solution for the problem?

 

I would appreciate any help / ideas!

 

Thanks in advance!

 

Best,

Daria     


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

 

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

From daria.laptinskaya at googlemail.com  Fri Sep 18 11:40:13 2015
From: daria.laptinskaya at googlemail.com (Daria Laptinskaya)
Date: Fri, 18 Sep 2015 11:40:13 +0200
Subject: [FieldTrip] Problem with ft_megrealign
In-Reply-To: <020101d0f1e9$c0dbab00$42930100$@artinis.com>
References: <CADcxnnOuyYNG_X=zcZoEGH0yPnb=mqpNgEK_C0UvyYaJQYvT0A@mail.gmail.com>
 <007801d0eba6$10816b80$31844280$@artinis.com>
 <CADcxnnNDRP_DYQGq+uEeqKJVvVd+AEzXNszbPwc1LWC13wqJjw@mail.gmail.com>
 <020101d0f1e9$c0dbab00$42930100$@artinis.com>
Message-ID: <CADcxnnM4uSDbfhAoZ5JA4A5UsF1HwpOJtM=sczqScBe66iS1AA@mail.gmail.com>

Dear Jörn,


yes, I tried the latest version of FT – thank you for the advice!

The function works fine, when I leave out the cfg.headshape:



    cfg = [];

    cfg.headmodel.r = 12;

    cfg.headmodel.o = [0, 0, 4];

    cfg.template    = sens_m;

    cfg.channel     = {'MEG'};

    cfg.inwardshift =  2.5;

   % cfg.headshape   = 'hs_file';



    realigned_data= ft_megrealign(cfg, input_data);



Unfortunately,I still get the following error message, after including the
cfg.headshape.

Reference to non-existent field 'xgrid'.

Error in ft_prepare_sourcemodel (line 665)

  xmin_indx = find(grid.xgrid==xmin);



I thought, that something must be wrong with my headshape-file and tried
the ft_prepare_sourcemodel-function and it’s fine:



shape = ft_read_headshape('hs_file');



cfg = [];

cfg.grid.pos = shape.pnt;

cfg.grid.xgrid  = 'auto';

cfg.grid.ygrid  = 'auto';

cfg.grid.zgrid  = 'auto';

grid = ft_prepare_sourcemodel(cfg, input_data);



My shape/grid-variable looks like this:

 [image: Inline-Bild 1]


Till now I could not find the solution for the problem.

Do someone have an idea?



Thank you very much in advance for your time!



Best,

Daria





2015-09-18 10:12 GMT+02:00 Jörn M. Horschig <jorn at artinis.com>:

> Dear Daria,
>
>
>
> have you tried the most recent version of FT? This should have been
> resolved there.
>
>
>
> Best,
>
> Jörn
>
>
>
> *--*
>
>
>
> *Jörn M. Horschig, PhD*, Software Engineer
>
> Artinis Medical Systems <http://www.artinis.com/>  |  +31 481 350 980
>
>
>
> *From:* fieldtrip-bounces at science.ru.nl [mailto:
> fieldtrip-bounces at science.ru.nl] *On Behalf Of *Daria Laptinskaya
> *Sent:* Tuesday, September 15, 2015 11:36 AM
> *To:* FieldTrip discussion list <fieldtrip at science.ru.nl>
> *Subject:* Re: [FieldTrip] Problem with ft_megrealign
>
>
>
> Dear Jörn,
>
>
>
> thank you very much for your helpful answer! I did not want to answer
> before running the function. First I got an error message with the notice
> that separate structures of the cfg.template could not be translated into a
> variable of the type double (template variable).  Hence I defined the
> template variable as a cell-array:
>
> Ntemplate = length(cfg.template);
>
> template = cell(Ntemplate, 1);
>
>
>
> and at the end did this:
>
> j = 1;
>
> for i=1:length(template)
>
>
>
>     eval(['tp', num2str(j), ' = template{1};'])
>
>
>
>     j = j+1;
>
> end
>
> template_new = ([tp1, tp2]);
>
> grad = ft_average_sens(template_new);
>
>
>
> Now it works fine, then I leave out the cfg.headshape = ‘hs_file’.  Using
> this command is leading to the following error message: Reference to
> non-existent field 'xgrid'. I understand the message, but could not fix the
> problem till now. I could swear, it worked some time ago :).
>
> I’m sorry to bother you with this, but I would appreciate, if you or
> someone else could give me a further tip, how to solve the problem.
>
> Many thank in advance!
>
>
>
> Best,
>
> Daria
>
>
>
> 2015-09-10 10:52 GMT+02:00 Jörn M. Horschig <jorn at artinis.com>:
>
> Dear Daria,
>
>
>
> try initializing tp_avg just before the for-loop, e.g. by set tp_avg = []
>
>
>
> The error message you got means that you have a function called template
> somewhere in your path. In the command line, you can type
>
> >> which template
>
> to find out where function is located. Afaik it’s not a FieldTrip
> function.  Anyway, to fix this, the template variable should have been
> initialized in the same vein as I described above. I’ll quickly fix this so
> that this does not happen anymore in the new version (from tomorrow
> onwards).
>
> This means, also for you the fix would have been just to initialize the
> template variable rather than renaming the variable, but your solution also
> works fine after initializing the variable ;)
>
>
>
> Best,
>
> Jörn
>
>
>
>
>
>
>
> *--*
>
>
>
> *Jörn M. Horschig, PhD*, Software Engineer
>
> Artinis Medical Systems <http://www.artinis.com/>  |  +31 481 350 980
>
>
>
> *From:* fieldtrip-bounces at science.ru.nl [mailto:
> fieldtrip-bounces at science.ru.nl] *On Behalf Of *Daria Laptinskaya
> *Sent:* Thursday, September 10, 2015 10:39 AM
> *To:* FieldTrip discussion list <fieldtrip at science.ru.nl>
> *Subject:* [FieldTrip] Problem with ft_megrealign
>
>
>
> Dear all,
>
> I would like to apply the ft_megrealign function to MEG data.
>
> First I tried this:
>
>     cfg             = [];
>
>     cfg.vol.r       = 12;
>
>     cfg.vol.o       = [0, 0, 4];
>
>     cfg.template    = allsens;
>
>     cfg.channel     = {'MEG'};
>
>     cfg.inwardshift =  1;
>
>     cfg.headshape   = 'hs_file';
>
>
>
> new_data = ft_megrealign(cfg, old_data);
>
>
>
> Then I got the following error message:
>
> At compilation, "template" was determined to be a variable and this
> variable is
> uninitialized. "template" is also a function name and previous versions of
> MATLAB would
> have called the function. However, MATLAB 7 forbids the use of the same
> name in the same
> context as both a function and a variable.
>
>
>
> I thought that renaming the variable “template” would solve the problem
> and did the following within the original function (replaced the
> template-variable with the Ntp_avg variable):
>
>
>
> Ntp_avg = length(cfg.template);
>
> for i=1:Ntp_avg
>
>   if ischar(cfg.template{i}),
>
>     fprintf('reading template sensor position from %s\n',
> cfg.template{i});
>
>     tp_avg(i) = ft_read_sens(cfg.template{i});
>
>   elseif isstruct(cfg.template{i}) && isfield(cfg.template{i}, 'coilpos')
> && isfield(cfg.template{i}, 'coilori') && isfield(cfg.template{i}, 'tra'),
>
>     tp_avg(i) = cfg.template{i};
>
>   end
>
> end
>
>
>
> No I get an error message, that “the variable tp_avg is not defined”.
>
> Do I forget something? Or do anyone have an other solution for the problem?
>
>
>
> I would appreciate any help / ideas!
>
>
>
> Thanks in advance!
>
>
>
> Best,
>
> Daria
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150918/5acbab94/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 7263 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150918/5acbab94/attachment.png>

From icelandhouse at gmail.com  Fri Sep 18 17:35:45 2015
From: icelandhouse at gmail.com (Maris Skujevskis)
Date: Fri, 18 Sep 2015 17:35:45 +0200
Subject: [FieldTrip] zero-padding VS mirror-padding (ft_freqanalysis)
Message-ID: <CAKEvDidevGZnEorYvkmMBhOoo_94v03nyo3Vo04ipB+Yk8cUGg@mail.gmail.com>

Dear Fieldtrip community,

I am currently doing frequency analysis on an EEG dataset.

My question is a general one about the dis/advantages of zero- VS
mirror-padding a finite time series prior to frequency analysis
(ft_freqanalysis).

The way ft_freqanalysis is implemented suggests that zero padding is always
the best option, e.g., ft_freqanalysis does not support mirror padding.

However, it seems to me that mirror padding is also a good and a valid way
to address the 'missing values' issue at the temporal edges of a TFR.
Here is my (intuitive) reasoning:
The disadvantage of zero padding is that it creates a discontinuity at the
edges of the data segment, thus introducing additional frequency content
and distorting the power estimates. Mirror padding might overestimate the
power of the frequencies present, but, to its advantage, it preserves the
frequency content of the actual data. Short summary: both ways of padding
have their strengths and weaknesses, there is no clear winner.


It would be good to hear what other researchers think about the
advantages/disadvantages of the two ways of padding.
Is zero-padding always a better way of padding than mirror- (or any other
type of) padding?
Does the answer depend on some further factors?

Best wishes,
Maris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150918/9e688c65/attachment.htm>

From russgport at gmail.com  Sat Sep 19 02:27:09 2015
From: russgport at gmail.com (russ port)
Date: Fri, 18 Sep 2015 20:27:09 -0400
Subject: [FieldTrip] citation sources for ica analysis
Message-ID: <C3332A05-8C45-466B-B7E5-7DF93EF29C81@gmail.com>

Hi All,

I was writing up my methods, and currently I implement a script derived from (http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts <http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts>, http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts <http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts>) for ica removal of EOG and ECG artifacts. I don't want to take credit for something that I did not come up with, so I want to properly cite these works. Unfortunately I cannot see a reference on these pages for their methodology, or a publication on the literature page that seems to correspond.

Best,
Russ P
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150918/624ead79/attachment.htm>

From v.piai.research at gmail.com  Sat Sep 19 05:31:03 2015
From: v.piai.research at gmail.com (=?UTF-8?Q?Vit=c3=b3ria_Piai?=)
Date: Fri, 18 Sep 2015 20:31:03 -0700
Subject: [FieldTrip] citation sources for ica analysis
In-Reply-To: <C3332A05-8C45-466B-B7E5-7DF93EF29C81@gmail.com>
References: <C3332A05-8C45-466B-B7E5-7DF93EF29C81@gmail.com>
Message-ID: <55FCD6F7.8060902@gmail.com>

Hi Russ,

If I'm not mistaken, FieldTrip uses the eeglab implementation, see here: 
http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts?s[]=eeglab

% perform the independent component analysis (i.e., decompose the data)
cfg        = [];
cfg.method = 'runica'; % this is the default and uses the implementation fromEEGLAB

In this case, the eeglab website (http://sccn.ucsd.edu/eeglab/refs.html) 
seems to indicate this reference:

A Delorme & S Makeig (2004) EEGLAB: an open source toolbox for analysis 
of single-trial EEG dynamics 
<http://sccn.ucsd.edu/eeglab/download/eeglab_jnm03.pdf> (pdf, 0.7 MB) 
/Journal of Neuroscience Methods/ 134:9-21

    /Includes details of EEGLAB ICA and time/frequency methods./ /Please
    cite this paper to reference EEGLAB in publications./

Hopefully someone can confirm that for you in case you're still in doubt.
Cheers, Vitoria

On 9/18/2015 5:27 PM, russ port wrote:
> Hi All,
>
> I was writing up my methods, and currently I implement a script 
> derived from 
> (http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts, 
> http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts) 
> for ica removal of EOG and ECG artifacts. I don't want to take credit 
> for something that I did not come up with, so I want to properly cite 
> these works. Unfortunately I cannot see a reference on these pages for 
> their methodology, or a publication on the literature page that seems 
> to correspond.
>
> Best,
> Russ P
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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

From russgport at gmail.com  Sat Sep 19 05:46:23 2015
From: russgport at gmail.com (russ port)
Date: Fri, 18 Sep 2015 23:46:23 -0400
Subject: [FieldTrip] citation sources for ica analysis
In-Reply-To: <55FCD6F7.8060902@gmail.com>
References: <C3332A05-8C45-466B-B7E5-7DF93EF29C81@gmail.com>
 <55FCD6F7.8060902@gmail.com>
Message-ID: <9584EC14-5669-4B7E-B637-436C9EDC25CD@gmail.com>

Hi Vitoria

Thanks. Thats great


> On Sep 18, 2015, at 11:31 PM, Vitória Piai <v.piai.research at gmail.com> wrote:
> 
> Hi Russ, 
> 
> If I'm not mistaken, FieldTrip uses the eeglab implementation, see here: http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts?s <http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts?s>[]=eeglab
> % perform the independent component analysis (i.e., decompose the data)
> cfg        = [];
> cfg.method = 'runica'; % this is the default and uses the implementation from EEGLAB
> 
> In this case, the eeglab website (http://sccn.ucsd.edu/eeglab/refs.html <http://sccn.ucsd.edu/eeglab/refs.html>) seems to indicate this reference:
> A Delorme & S Makeig (2004) EEGLAB: an open source toolbox for analysis of single-trial EEG dynamics <http://sccn.ucsd.edu/eeglab/download/eeglab_jnm03.pdf> (pdf, 0.7 MB) Journal of Neuroscience Methods 134:9-21 
> 
> Includes details of EEGLAB ICA and time/frequency methods. Please cite this paper to reference EEGLAB in publications.
> Hopefully someone can confirm that for you in case you're still in doubt.
> Cheers, Vitoria
> 
> On 9/18/2015 5:27 PM, russ port wrote:
>> Hi All,
>> 
>> I was writing up my methods, and currently I implement a script derived from (http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts <http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts>,  <http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts>http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts <http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts>) for ica removal of EOG and ECG artifacts. I don't want to take credit for something that I did not come up with, so I want to properly cite these works. Unfortunately I cannot see a reference on these pages for their methodology, or a publication on the literature page that seems to correspond.
>> 
>> Best,
>> Russ P
>> 
>> 
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip <http://mailman.science.ru.nl/mailman/listinfo/fieldtrip>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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

From tzvetan.popov at uni-konstanz.de  Sat Sep 19 09:40:28 2015
From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov)
Date: Sat, 19 Sep 2015 09:40:28 +0200
Subject: [FieldTrip] zero-padding VS mirror-padding (ft_freqanalysis)
In-Reply-To: <CAKEvDidevGZnEorYvkmMBhOoo_94v03nyo3Vo04ipB+Yk8cUGg@mail.gmail.com>
References: <CAKEvDidevGZnEorYvkmMBhOoo_94v03nyo3Vo04ipB+Yk8cUGg@mail.gmail.com>
Message-ID: <F24A6ECD-0250-48E8-B448-219D5BB88D37@uni-konstanz.de>

Dear Maris,
You could also use data padding, i.e. epoch the data as longer segments perform freqanalysis and use ft_selectdata to re-epoch to the desired length.
Cheers
Tzvetan



> Am 18.09.2015 um 17:35 schrieb Maris Skujevskis <icelandhouse at gmail.com>:
> 
> Dear Fieldtrip community,
> 
> I am currently doing frequency analysis on an EEG dataset. 
> 
> My question is a general one about the dis/advantages of zero- VS mirror-padding a finite time series prior to frequency analysis (ft_freqanalysis). 
> 
> The way ft_freqanalysis is implemented suggests that zero padding is always the best option, e.g., ft_freqanalysis does not support mirror padding.
> 
> However, it seems to me that mirror padding is also a good and a valid way to address the 'missing values' issue at the temporal edges of a TFR. 
> Here is my (intuitive) reasoning:
> The disadvantage of zero padding is that it creates a discontinuity at the edges of the data segment, thus introducing additional frequency content and distorting the power estimates. Mirror padding might overestimate the power of the frequencies present, but, to its advantage, it preserves the frequency content of the actual data. Short summary: both ways of padding have their strengths and weaknesses, there is no clear winner.
> 
> 
> It would be good to hear what other researchers think about the advantages/disadvantages of the two ways of padding. 
> Is zero-padding always a better way of padding than mirror- (or any other type of) padding? 
> Does the answer depend on some further factors?
> 
> Best wishes,
> Maris
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



From david.m.groppe at gmail.com  Sun Sep 20 19:22:40 2015
From: david.m.groppe at gmail.com (David Groppe)
Date: Sun, 20 Sep 2015 13:22:40 -0400
Subject: [FieldTrip] citation sources for ica analysis
In-Reply-To: <9584EC14-5669-4B7E-B637-436C9EDC25CD@gmail.com>
References: <C3332A05-8C45-466B-B7E5-7DF93EF29C81@gmail.com>
 <55FCD6F7.8060902@gmail.com> <9584EC14-5669-4B7E-B637-436C9EDC25CD@gmail.com>
Message-ID: <CAOgkkokPMyUGtna6eN7_L9ZUPvzLkVx-7AWnQZEDGCwU_5dk5Q@mail.gmail.com>

Hi Russ,
   If you want to be more specific, this is first published application of
ICA to EEG data (and it turns out to be from the group that went on to make
EEGLAB):

Makeig, S., Bell, A. J., Jung, T.-P., & Sejnowski, T. J. (1996).
Independent component analysis of electroencephal- ographic data. In D.
Touretzky, M. Mozer & M. Hasselmo (Eds.), Advances in Neural Information
Processing Systems 8 (pp. 145-151). Cambridge, MA: MIT Press.



And I believe this is the first published use of ICA for EEG artifact
correction:

Jung, T.-P., Makeig, S., Humphries, C., Lee, T. W., McKeown, M. J.,
Iragui, V. J., et al. (2000). Removing electroencephalographic artifacts
by blind source separation. Psychophysiology, 37(2), 163-178.


cheers,
    -David


On Fri, Sep 18, 2015 at 11:46 PM, russ port <russgport at gmail.com> wrote:

> Hi Vitoria
>
> Thanks. Thats great
>
>
> On Sep 18, 2015, at 11:31 PM, Vitória Piai <v.piai.research at gmail.com>
> wrote:
>
> Hi Russ,
>
> If I'm not mistaken, FieldTrip uses the eeglab implementation, see here:
> http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts?s
> []=eeglab
>
> % perform the independent component analysis (i.e., decompose the data)
> cfg        = [];
> cfg.method = 'runica'; % this is the default and uses the implementation from EEGLAB
>
> In this case, the eeglab website (http://sccn.ucsd.edu/eeglab/refs.html)
> seems to indicate this reference:
>
> A Delorme & S Makeig (2004) EEGLAB: an open source toolbox for analysis
> of single-trial EEG dynamics
> <http://sccn.ucsd.edu/eeglab/download/eeglab_jnm03.pdf> (pdf, 0.7 MB) *Journal
> of Neuroscience Methods* 134:9-21
>
> *Includes details of EEGLAB ICA and time/frequency methods.* *Please cite
> this paper to reference EEGLAB in publications.*
>
> Hopefully someone can confirm that for you in case you're still in doubt.
> Cheers, Vitoria
>
> On 9/18/2015 5:27 PM, russ port wrote:
>
> Hi All,
>
> I was writing up my methods, and currently I implement a script derived
> from (
> http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_eog_artifacts
> ,
> <http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts>
> http://www.fieldtriptoolbox.org/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts)
> for ica removal of EOG and ECG artifacts. I don't want to take credit for
> something that I did not come up with, so I want to properly cite these
> works. Unfortunately I cannot see a reference on these pages for their
> methodology, or a publication on the literature page that seems to
> correspond.
>
> Best,
> Russ P
>
>
> _______________________________________________
> fieldtrip mailing listfieldtrip at donders.ru.nlhttp://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150920/cc6dbff0/attachment.htm>

From icelandhouse at gmail.com  Mon Sep 21 10:42:31 2015
From: icelandhouse at gmail.com (Maris Skujevskis)
Date: Mon, 21 Sep 2015 10:42:31 +0200
Subject: [FieldTrip] zero-padding VS mirror-padding (ft_freqanalysis)
Message-ID: <CAKEvDieJ7k=9Wf1sV6rXw3FiK_JLJOL82wbSbVxVVc9A1X2aTw@mail.gmail.com>

Thanks for you suggestion Tzvetan!

I was trying to avoid data-padding since both prior and after my period of
interest the participant receives sensory stimuli, so the brain signal in
the periods preceding and following my period of interest is radically
different.
For this reason I thought that it is better to use either mirror- or zero-
padding instead. Would you agree?

I still don't know which one though, hence my previous 'mirror VS zero
padding' question.

Best,
Maris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150921/739252af/attachment.htm>

From tzvetan.popov at uni-konstanz.de  Mon Sep 21 11:09:17 2015
From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov)
Date: Mon, 21 Sep 2015 11:09:17 +0200
Subject: [FieldTrip] zero-padding VS mirror-padding (ft_freqanalysis)
In-Reply-To: <CAKEvDieJ7k=9Wf1sV6rXw3FiK_JLJOL82wbSbVxVVc9A1X2aTw@mail.gmail.com>
References: <CAKEvDieJ7k=9Wf1sV6rXw3FiK_JLJOL82wbSbVxVVc9A1X2aTw@mail.gmail.com>
Message-ID: <F47C3E58-3E10-411D-9BD6-B695E3FAB0A5@uni-konstanz.de>

Hi,


> Thanks for you suggestion Tzvetan!
> 
> I was trying to avoid data-padding since both prior and after my period of interest the participant receives sensory stimuli, so the brain signal in the periods preceding and following my period of interest is radically different. 
Well it depends on the sliding window length at the end I guess. If it’s not feasible -sure.
> For this reason I thought that it is better to use either mirror- or zero- padding instead. Would you agree?
I would try both and see how they affect the dependent metric. Your ultimate goal I suspect is to reject H0. If this is equally possible with either strategy- fine.  
> I still don't know which one though, hence my previous 'mirror VS zero padding' question.
Seems that you don’t have much of a baseline to begin with. Would frequency analysis also be an option?
best
tzvetan

> 
> Best,
> Maris
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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

From icelandhouse at gmail.com  Mon Sep 21 12:28:41 2015
From: icelandhouse at gmail.com (Maris Skujevskis)
Date: Mon, 21 Sep 2015 12:28:41 +0200
Subject: [FieldTrip] zero-padding VS mirror-padding (ft_freqanalysis)
Message-ID: <CAKEvDienLbhLyW1=aQrsxAnSy5-bkLTzd2SijvehZA=ORekwHA@mail.gmail.com>

Hi,

Thanks again for the suggestions, Tzvetan.

>I still don't know which one though, hence my previous 'mirror VS zero
padding' question.
>>Seems that you don?t have much of a baseline to begin with. Would
frequency analysis also be an option?

Perhaps I don't understand the question, but yes - I am doing frequency
analysis. The period of interest is the delay (3 sec) between two
relatively short sensory stimulation periods (0.5sec).
I do have a baseline - it is the time period prior to the
"Stimulation-Delay-Stimulation" sequence. Besides that, I can also contrast
different stimulation conditions without the need for a baseline.
I am not sure how it relates to the first part of our discussion, but I
guess a few more details can't hurt it either.


Best,
Maris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150921/1b105d41/attachment.htm>

From tzvetan.popov at uni-konstanz.de  Mon Sep 21 14:06:09 2015
From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov)
Date: Mon, 21 Sep 2015 14:06:09 +0200
Subject: [FieldTrip] zero-padding VS mirror-padding (ft_freqanalysis)
In-Reply-To: <CAKEvDienLbhLyW1=aQrsxAnSy5-bkLTzd2SijvehZA=ORekwHA@mail.gmail.com>
References: <CAKEvDienLbhLyW1=aQrsxAnSy5-bkLTzd2SijvehZA=ORekwHA@mail.gmail.com>
Message-ID: <195A9E11-6B90-47EA-A6DE-DA08459B558F@uni-konstanz.de>

Hi 
> Hi,
> 
> Thanks again for the suggestions, Tzvetan. 
> 
> >I still don't know which one though, hence my previous 'mirror VS zero padding' question.
> >>Seems that you don?t have much of a baseline to begin with. Would frequency analysis also be an option?
> 
> Perhaps I don't understand the question, but yes - I am doing frequency analysis.
Sorry, I meant frequency analysis and not time-frequency representation. The former isn#t dependent on the issues you have trouble with.
> The period of interest is the delay (3 sec) between two relatively short sensory stimulation periods (0.5sec).
> I do have a baseline - it is the time period prior to the "Stimulation-Delay-Stimulation" sequence. Besides that, I can also contrast different stimulation conditions without the need for a baseline.
> I am not sure how it relates to the first part of our discussion, but I guess a few more details can't hurt it either.
You’re right it drifts a bit. I don’t have much of an opinion/experience on zero vs. mirror padding. Data padding still seems feasible to me, say baseline onset to baseline offset? Then re-segment to "Simulation offset plus half of the sliding window” to “baseline onset minus half of the sliding window”.
greetz
tzvetan

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

From jrebola at gmail.com  Tue Sep 22 15:06:13 2015
From: jrebola at gmail.com (Jose Rebola)
Date: Tue, 22 Sep 2015 14:06:13 +0100
Subject: [FieldTrip] PLV comparison across conditions
Message-ID: <CAO=xuKLOyJJ-d1nW92X_z7XYuPCGcQPARfZ63rZSB_S9u2_vtw@mail.gmail.com>

Hi!



I am trying to assess if there is a difference in connectivity across two
conditions in my data. Condition 1 has 240 trials and condition 2 has 252
trials.

I have chosen to use the *phase-locking-value* as a measure of connectivity.

*My first question is:*



Which formula should I use to evaluate the difference between conditions?

Would   plv1- plv2 be appropriate, or do I have to do some kind of
transformation or normalization? If I choose to use other connectivity
measures, will it be much different?

 I have seen for example in the paper of Jan-Mathijs Schoffelen in 2011
that he uses the formula in the following image for the assessment of
differences between the coherence values x1 and x2.

I should note that I would like to evaluate differences at the
intra-subject level.


[image: Inline image 1]



*My second question is:*



In order to do the non-parametric testing, my null hypothesis is that there
are no differences between plv1 and plv2 ( I guess). So I can randomize
trial labels, evaluate plv1 and plv2 again, do this 1000 times and count
the number of times that this difference is bigger than my original
difference, right?



*My third and fourth questions concern clustering:*

In order to do clustering, I should first establish a threshold value for
the metric under evaluation. This may be easy to set if I was using
t-values, but if I am evaluating differences in means, what should be an
appropriate value to use?



Regarding spatial clustering, I now have two levels of “neighbour”
electrodes, right? At the seed level, and at the destination level. How can
these be clustered? I mean, if I consider for example the electrode-pairing
T7-P3, both T9-P3 and T7-P5 will be neighbours…



*Lastly,*

Are these issues already implemented in Fieldtrip or do I have to build my
own MATLAB code for the randomization, thresholding and clustering?



Thank you so much,



 José Rebola
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150922/944005f7/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 17815 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150922/944005f7/attachment.png>

From llominy00 at gmail.com  Tue Sep 22 16:11:57 2015
From: llominy00 at gmail.com (Luders Lominy)
Date: Tue, 22 Sep 2015 10:11:57 -0400
Subject: [FieldTrip] Importing Acqknowledge into fieldtrip
Message-ID: <CAD7hNZJ_1hGMgVQN18tT4W7pienr-+-bj=nEumnS1RJWjrjxCA@mail.gmail.com>

Hello all,

I am having trouble importing my Acqknowledge (.acq) data into fieldtrip.
I've been searching online how to import my data, but attempts haven't been
successful. If anyone can provide me with some insight on what approach I
can take it would be greatly appreciated.

Sincerely,

Luders Lominy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150922/a4848fa0/attachment.htm>

From m.fritsche at student.ru.nl  Thu Sep 24 11:06:33 2015
From: m.fritsche at student.ru.nl (Fritsche, M. (Matthias))
Date: Thu, 24 Sep 2015 09:06:33 +0000
Subject: [FieldTrip] Head movement correction for source time-courses
Message-ID: <4BC6B8ED-D49B-4D69-8B51-5F52629E3755@student.ru.nl>

Dear Fieldtrippers,

I started looking into offline head movement correction of MEG data wondered about the following:
Is it possible/sensible to correct time-courses of source reconstructed data for head movement (that is timepoint-by-timepoint for individual sources)?

The GLM approach with ft_regressconfound only computes trial-by-trial power estimates, whose variance due to head movement is removed, right? Is there a theoretical consideration that renders the timepoint-by-timepoint correction for individual sources pointless? Or is there maybe a technical limitation, e.g. in terms limited computation resources?

I couldn’t find any information on this on the wiki, or the mailing list archive. Please excuse if I should have overlooked something or if this is a silly question.

Best,
Matthias




From hzhang.lib at gmail.com  Thu Sep 24 15:44:22 2015
From: hzhang.lib at gmail.com (hui zhang)
Date: Thu, 24 Sep 2015 13:44:22 +0000
Subject: [FieldTrip] saw-tooth pattern of frequency spectrum
Message-ID: <5d803ec7983e4544a61e44e2661b5881@EXPRD03.hosting.ru.nl>

Dear fieldtrip community,

I have encountered a problem of time-frequency transformation on continuous data. Basically, the frequency spectrum established a rhythmic pattern as indicated in figures below (the first figure and the blue line in the second figure).
The code I use are as below:

cfg = [];
    cfg.reref = 'yes';
    cfg.refchannel = 'all';
    cfg.datafile = 'subj1.dat';
    cfg.headerfile = 'subj1.vhdr';
    cfg.bsfilter = 'yes';
    cfg.bsfreq = [49 51; 99 101; 149 151; 199 201];
    data_all = ft_preprocessing(cfg);


    cfg = [];
    cfg.method = 'wavelet';
    cfg.output = 'pow';
    cfg.keeptrials = 'yes';
    cfg.foi = 1:1:200;
    cfg.toi = 0:0.01:size(data_all.time{1},2)/data_all.fsample;
    cfg.trials = 'all';
    freq = ft_freqanalysis(cfg,data_all);


There are different methods I tried to improve the result
1). highpass filter the data (0.1 Hz)
2). bandpass filter the data ([0.1 300Hz])
3). detrend the data

Among these methods, 1) and 2) works better and generate the same result, but can still see the rhythmic pattern of the frequency spectrum with lower amplitude and slower frequencies of the saw-tooth pattern (The green line in the second figure).
3) does not work at all.

Any idea of why the saw-tooth pattern appears in the frequency spectrum? How to efficiently improve the result?
Thanks!


[Inline image 3]

Best,
Hui

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

From anne.urai at gmail.com  Thu Sep 24 21:35:31 2015
From: anne.urai at gmail.com (Anne Urai)
Date: Thu, 24 Sep 2015 21:35:31 +0200
Subject: [FieldTrip] Head movement correction for source time-courses
In-Reply-To: <4BC6B8ED-D49B-4D69-8B51-5F52629E3755@student.ru.nl>
References: <4BC6B8ED-D49B-4D69-8B51-5F52629E3755@student.ru.nl>
Message-ID: <etPan.56045083.6b114441.1fa@Annes-MacBook-Pro.local>

Hi Matthias,

If you want to regress out single-trial variance that's explained by head motion see this tutorial: http://www.fieldtriptoolbox.org/example/how_to_incorporate_head_movements_in_meg_analysis, I think it's equally valid to do this at the sensor vs source level.

Another method that is described in Stolk et al http://www.ncbi.nlm.nih.gov/pubmed/23246857 and originally Uutela et al http://www.ncbi.nlm.nih.gov/pubmed/11707098 is to incorporate changes in the grad structure into you source reconstruction procedure.

This is implemented in ft_headmovement, but I've personally not found it very intuitive to use - perhaps one of the authors could elaborate? Perhaps it's worth adding a short section on the wiki on this..

Cheers,
— 
Anne E. Urai, MSc
PhD student | Institut für Neurophysiologie und Pathophysiologie 
Universitätsklinikum Hamburg-Eppendorf | Martinistrasse 52, 20246 | Hamburg, Germany 
www.anneurai.net 

On 24 Sep 2015 at 14:46:34, Fritsche, M. (Matthias) (m.fritsche at student.ru.nl) wrote:

Dear Fieldtrippers,

I started looking into offline head movement correction of MEG data wondered about the following:
Is it possible/sensible to correct time-courses of source reconstructed data for head movement (that is timepoint-by-timepoint for individual sources)?

The GLM approach with ft_regressconfound only computes trial-by-trial power estimates, whose variance due to head movement is removed, right? Is there a theoretical consideration that renders the timepoint-by-timepoint correction for individual sources pointless? Or is there maybe a technical limitation, e.g. in terms limited computation resources?

I couldn’t find any information on this on the wiki, or the mailing list archive. Please excuse if I should have overlooked something or if this is a silly question.

Best,
Matthias


_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150924/3ac657a3/attachment.htm>

From bick35 at gmail.com  Fri Sep 25 06:20:29 2015
From: bick35 at gmail.com (Steph Bickel)
Date: Thu, 24 Sep 2015 21:20:29 -0700
Subject: [FieldTrip] data browser looking for missing cfg.headerformat
Message-ID: <A7786BFD-615F-409E-AAFC-3770D5D846BD@gmail.com>

Hello fieldtrip experts, 

I tried plotting an edf file. At line 325 the function ft_read_header seems to expect a field in the config structure that does not exist.
Do you know if I am doing something wrong or if this is a bug?

I am using the current field trip version downloaded from github.

Thank you!

Stephan


cfg=[];
cfg.viewmode = 'vertical';
cfg.continuous ='yes';
cfg.datafile = ‘/data/test.edf';
ft_databrowser(cfg)


Reference to non-existent field 'headerformat'.
Error in ft_databrowser (line 325)
  hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150924/3b7ae021/attachment.htm>

From stephen.whitmarsh at ki.se  Fri Sep 25 09:06:54 2015
From: stephen.whitmarsh at ki.se (Stephen Whitmarsh)
Date: Fri, 25 Sep 2015 07:06:54 +0000
Subject: [FieldTrip] data browser looking for missing cfg.headerformat
In-Reply-To: <A7786BFD-615F-409E-AAFC-3770D5D846BD@gmail.com>
References: <A7786BFD-615F-409E-AAFC-3770D5D846BD@gmail.com>
Message-ID: <C2A579D858882B47926827674B07F5015846C0FF@KIMSX02.user.ki.se>

Hi Stefan,

You haven’t defined the third argument you use in the call to ft_read_header, i.e. cfg.headerformat. You could change it to ‘edf’ I think, or just try to leave it out – pretty sure ft_read_header can figure out the dataformat.

Cheers,
Stephen

From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Steph Bickel
Sent: 25 September 2015 06:20
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] data browser looking for missing cfg.headerformat

Hello fieldtrip experts,

I tried plotting an edf file. At line 325 the function ft_read_header seems to expect a field in the config structure that does not exist.
Do you know if I am doing something wrong or if this is a bug?

I am using the current field trip version downloaded from github.

Thank you!

Stephan


cfg=[];
cfg.viewmode = 'vertical';
cfg.continuous ='yes';
cfg.datafile = ‘/data/test.edf';
ft_databrowser(cfg)


Reference to non-existent field 'headerformat'.
Error in ft_databrowser (line 325)
  hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);

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

From stephen.whitmarsh at ki.se  Fri Sep 25 09:12:36 2015
From: stephen.whitmarsh at ki.se (Stephen Whitmarsh)
Date: Fri, 25 Sep 2015 07:12:36 +0000
Subject: [FieldTrip] data browser looking for missing cfg.headerformat
In-Reply-To: <C2A579D858882B47926827674B07F5015846C0FF@KIMSX02.user.ki.se>
References: <A7786BFD-615F-409E-AAFC-3770D5D846BD@gmail.com>
 <C2A579D858882B47926827674B07F5015846C0FF@KIMSX02.user.ki.se>
Message-ID: <C2A579D858882B47926827674B07F5015846C11A@KIMSX02.user.ki.se>

Hi Stephan,

Sorry for misspelling your name – I know how it feels ☺

Stephen

From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Stephen Whitmarsh
Sent: 25 September 2015 09:07
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] data browser looking for missing cfg.headerformat

Hi Stefan,

You haven’t defined the third argument you use in the call to ft_read_header, i.e. cfg.headerformat. You could change it to ‘edf’ I think, or just try to leave it out – pretty sure ft_read_header can figure out the dataformat.

Cheers,
Stephen

From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Steph Bickel
Sent: 25 September 2015 06:20
To: fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>
Subject: [FieldTrip] data browser looking for missing cfg.headerformat

Hello fieldtrip experts,

I tried plotting an edf file. At line 325 the function ft_read_header seems to expect a field in the config structure that does not exist.
Do you know if I am doing something wrong or if this is a bug?

I am using the current field trip version downloaded from github.

Thank you!

Stephan


cfg=[];
cfg.viewmode = 'vertical';
cfg.continuous ='yes';
cfg.datafile = ‘/data/test.edf';
ft_databrowser(cfg)


Reference to non-existent field 'headerformat'.
Error in ft_databrowser (line 325)
  hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);

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

From r.braukmann at donders.ru.nl  Fri Sep 25 10:17:13 2015
From: r.braukmann at donders.ru.nl (Ricarda Braukmann)
Date: Fri, 25 Sep 2015 10:17:13 +0200
Subject: [FieldTrip] Rejecting EEG channels for specific trials
Message-ID: <CABZMocMFgwjTBBuX1Fcwe=V28eSKM5xmbDw66BFPDPHX7Q=Ofw@mail.gmail.com>

Hi everyone,

I am working with infant EEG data sets (128 channels, EGI) and I have a
question about the possibilities for rejecting channels using
ft_rejectvisual (cfg.method = 'trial').

In our data sets it often happens that a particular channel is bad only for
a couple of trials rather than being bad throughout the whole session.

Therefore, I was wondering if it is possible to mark a channel as bad for
specific trials only rather than the whole session, for example using
ft_rejectvisual (or any other fieldtrip function)?

As far as I know, we can interpolate channels for specific trials, but
ft_rejectvisual seems to only be able to reject channels entirely.

If this is indeed not possible at the moment, do people think that there
would be a way for me to adapt the code in order to be able to do this?
I am not sure how easy this would be, but I am willing to give it a try :)

It would be great to hear your advice on this!
Best,
Ricarda

-- 

Ricarda Braukmann, MSc
PhD student

Radboud University Medical Centre & Baby Research Center

Donders Institute for Brain, Cognition and Behaviour,
Centre for Neuroscience & Centre for Cognition

Room B.01.22
Phone: +31 (0) 24 36 12652
Email: r.braukmann at donders.ru.nl
Website: http://www.zebra-project.nl/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150925/1517e2bc/attachment.htm>

From scott.fairhall at unitn.it  Fri Sep 25 15:44:55 2015
From: scott.fairhall at unitn.it (Scott Laurance Fairhall)
Date: Fri, 25 Sep 2015 15:44:55 +0200
Subject: [FieldTrip] Call for Expressions of Interest: Principal
	Investigator, CIMeC.
Message-ID: <55C0B037-0972-4124-9CB1-27A3E73F1D5C@unitn.it>

MEG Principal Investigator, Center for Mind-Brain Sciences (CIMeC), Trento, Italy

The Center for Mind-Brain Sciences (CIMeC) at the University of Trento, Italy, invites expressions of interest from highly motivated scholars for a principal investigator position at the assistant (tenure-track) / associate (tenured) professor level in the magnetoencephalography (MEG) laboratory at the Center for Mind-Brain Sciences (CIMeC): http://web.unitn.it/en/cimec <http://web.unitn.it/en/cimec>

Profile
One of the duties will be to coordinate and facilitate MEG research at CIMeC, acting as faculty coordinator of the MEG lab. Therefore a demonstration of strong organisational and collaborative skills is an asset.
Interested scholars must have an excellent research record, especially using electrophysiological techniques (M/EEG).
The successful candidate would be expected to contribute to the Center’s overall goal of delivering teaching at MSc and PhD level, and developing cutting-edge research in the area of Cognitive Neuroscience.

CIMeC
The CIMeC's purpose is to foster cutting-edge research on the neural underpinnings of cognition and to support the dissemination of these findings internationally and within the local community. As an interdisciplinary research and teaching center, the center draws on faculty from several departments, including Psychology and Cognitive Science, Humanities and Philosophy, Physics, Mathematics, and Information Engineering and Computer Science. Its faculty originates from Italy, Germany, The Netherlands, Belgium, USA, Canada, Argentina, Israel and beyond. Researchers study brain organization via the analysis of its functional, structural and physiological characteristics, in both normal and pathological conditions. Top-of-the-line instrumentation includes research-dedicated MRI, MEG, EEG, NIRS, TMS and eye tracking solutions, as well as systems for studying kinematics. In addition, the affiliated Center for Neurocognitive Rehabilitation (CERiN) is specialized in the study of clinical cases.
In the last 5 years CIMeC faculty have won many competitive national and international grants, including 1 European Research Council (ERC) advanced grant, 1 ERC consolidator grant, 6 ERC starting grants, other European Framework grants and highly competitive grants awarded by the local province. The center has recently been ranked the leading cognitive neuroscience research unit in Italy.

The University of Trento is committed to providing equal opportunities regardless of gender and race.
Expressions of interest, in the form of a brief motivation letter and CV, can be communicated to the designated search committee composed of:
Marius Peelen (Marius.Peelen at unitn.it <mailto:Marius.Peelen at unitn.it>) and Scott Fairhall (Scott.Fairhall at unitn.it <mailto:Scott.Fairhall at unitn.it>), preferably before November 15th, 2015.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150925/7bde143b/attachment.htm>

From jia.wu at yale.edu  Fri Sep 25 16:46:30 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Fri, 25 Sep 2015 14:46:30 +0000
Subject: [FieldTrip] change orientation of MRI or source plot
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E284DE@x10-mbx13.yu.yale.edu>

Hi,

I have a question about the orientation of MRI and source plot. I made the some comparison plot as below.
http://imgur.com/a/FoMAH

The top image is a plot of the T1template, which follows the convention that the top left is coronal, top right is sagittal and the bottom left is axial.

The bottom image is from Subject01.mri downloaded from the fieldtrip server and applied volumeslice. (Without using volumeslice the orientation is not correct either). The coronal and sagittal views were switched.

I'm wondering whether there is a way that I can change the orientation of the plot.

best,
-jia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150925/8e33b435/attachment.htm>

From tzvetan.popov at uni-konstanz.de  Fri Sep 25 19:44:15 2015
From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov)
Date: Fri, 25 Sep 2015 19:44:15 +0200
Subject: [FieldTrip] change orientation of MRI or source plot
In-Reply-To: <AA21F9F31911364596BE68CA1AAD8DA466E284DE@x10-mbx13.yu.yale.edu>
References: <AA21F9F31911364596BE68CA1AAD8DA466E284DE@x10-mbx13.yu.yale.edu>
Message-ID: <8B216DA7-B5AC-421D-AC80-4EFC03E95884@uni-konstanz.de>

Hi Jia,
yes there is a way. Please have a look at this FAQ:
http://www.fieldtriptoolbox.org/faq/my_mri_is_upside_down_is_this_a_problem

and also this one: http://www.fieldtriptoolbox.org/faq/how_change_mri_orientation_size_fov
Good luck,
tzvetan


> Hi,
> 
> I have a question about the orientation of MRI and source plot. I made the some comparison plot as below.
> http://imgur.com/a/FoMAH
> 
> The top image is a plot of the T1template, which follows the convention that the top left is coronal, top right is sagittal and the bottom left is axial. 
> 
> The bottom image is from Subject01.mri downloaded from the fieldtrip server and applied volumeslice. (Without using volumeslice the orientation is not correct either). The coronal and sagittal views were switched. 
> 
> I'm wondering whether there is a way that I can change the orientation of the plot.
> 
> best,
> -jia
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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

From Max.Cantor at Colorado.EDU  Sat Sep 26 00:17:07 2015
From: Max.Cantor at Colorado.EDU (Max Cantor)
Date: Fri, 25 Sep 2015 16:17:07 -0600
Subject: [FieldTrip] Filter Order for High Pass Filter
Message-ID: <CAOv1Hy2vVF2oYFVMHtm+hbA2-zXpgkapqFodzHnF_OA8Yp09RQ@mail.gmail.com>

Hi all,

I used to be mcantor at umich.edu, now I'm max.cantor at colorado.edu, but I'm
the same Max Cantor as before :).

That out of the way, here is my question:

In the these threads -
http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008308.html
http://mailman.science.ru.nl/pipermail/fieldtrip/2012-June/005351.html

The issue of fieldtrip's ability to do low valued high pass filters is
addressed, and I was successfully able to implement a a bpfilter of [0.1
50] hz using a filter order of 1, and I compared it to my new lab's eeglab
pipeline's ERP for a given subject and was able to get a more or less
identical output. However, it's been awhile since I've read some of the
nitty gritty signal processing, and I forget what exactly this means or
what the significance of it is.

Even though I was able to more or less replicate their current pipeline,
I'd still like to understand what exactly setting the filter order is doing
and what the significance of it may be. If anyone can explain this to me or
set me in the right direction (a suggested chapter in Steve Luck or Matt
Cohen's book, or a good article, for instance), I would greatly appreciate
it.

Thanks,

Max

-- 
Max Cantor
Graduate Student
Cognitive Neuroscience of Language Lab
University of Colorado Boulder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150925/99a1827a/attachment.htm>

From v.piai.research at gmail.com  Sat Sep 26 01:52:57 2015
From: v.piai.research at gmail.com (Vitoria Piai)
Date: Fri, 25 Sep 2015 16:52:57 -0700
Subject: [FieldTrip] Filter Order for High Pass Filter
In-Reply-To: <CAOv1Hy2vVF2oYFVMHtm+hbA2-zXpgkapqFodzHnF_OA8Yp09RQ@mail.gmail.com>
References: <CAOv1Hy2vVF2oYFVMHtm+hbA2-zXpgkapqFodzHnF_OA8Yp09RQ@mail.gmail.com>
Message-ID: <5605DE59.6020201@gmail.com>

Hi Max,

Maybe, just maybe, this paper may help a bit:
Widmann, A., Schröger, E., & Maess, B. (2015). Digital filter design for 
electrophysiological data - a practical approach. /Journal of 
Neuroscience Methods/, /250/, 34-46.

Good luck, Vitoria

On 9/25/2015 3:17 PM, Max Cantor wrote:
> Hi all,
>
> I used to be mcantor at umich.edu <mailto:mcantor at umich.edu>, now I'm 
> max.cantor at colorado.edu <mailto:max.cantor at colorado.edu>, but I'm the 
> same Max Cantor as before :).
>
> That out of the way, here is my question:
>
> In the these threads -
> http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008308.html
> http://mailman.science.ru.nl/pipermail/fieldtrip/2012-June/005351.html
>
> The issue of fieldtrip's ability to do low valued high pass filters is 
> addressed, and I was successfully able to implement a a bpfilter of 
> [0.1 50] hz using a filter order of 1, and I compared it to my new 
> lab's eeglab pipeline's ERP for a given subject and was able to get a 
> more or less identical output. However, it's been awhile since I've 
> read some of the nitty gritty signal processing, and I forget what 
> exactly this means or what the significance of it is.
>
> Even though I was able to more or less replicate their current 
> pipeline, I'd still like to understand what exactly setting the filter 
> order is doing and what the significance of it may be. If anyone can 
> explain this to me or set me in the right direction (a suggested 
> chapter in Steve Luck or Matt Cohen's book, or a good article, for 
> instance), I would greatly appreciate it.
>
> Thanks,
>
> Max
>
> -- 
> Max Cantor
> Graduate Student
> Cognitive Neuroscience of Language Lab
> University of Colorado Boulder
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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

From widmann at uni-leipzig.de  Sat Sep 26 11:04:30 2015
From: widmann at uni-leipzig.de (Andreas Widmann)
Date: Sat, 26 Sep 2015 11:04:30 +0200
Subject: [FieldTrip] Filter Order for High Pass Filter
In-Reply-To: <CAOv1Hy2vVF2oYFVMHtm+hbA2-zXpgkapqFodzHnF_OA8Yp09RQ@mail.gmail.com>
References: <CAOv1Hy2vVF2oYFVMHtm+hbA2-zXpgkapqFodzHnF_OA8Yp09RQ@mail.gmail.com>
Message-ID: <765DC6B0-4EE1-4D42-B3A6-91685DF1A8A6@uni-leipzig.de>

Hi Max,

the filter order defines how steep or shallow the transition between passband and stopband is (in the frequency response). The higher the steeper.

For the Fieldtrip default Butterworth IIR filter this is -6 dB/oct per order (the order is doubled internally due to forward and backward filtering, so actually -12 dB/oct per order). For extreme filters (0.1 Hz highpass) Butterworth filters sometimes have stability issues (accumulating rounding errors). There’s now a strategy implemented dealing with these cases iirc.

The order of IIR and FIR filters must not be directly compared. For FIR filters the order is the impulse response length minus one. Thus, to compare IIR and FIR the impulse response length should be compared. The above Butterworth filter has an impulse response length of 7880 points to be doubled due to forward and backward filtering (-1; 15759 points). A corresponding FIR filter (500 Hz, Hamming window) only requires 8251 points. As most EEG textbooks explicitly recommend shorter filters over longer filters you might want to consider applying a FIR filter (e.g., cfg.hpfilttype = 'firws‘; cfg.hpfiltdir = 'onepass-zerophase';).

Best,
Andreas

> Am 26.09.2015 um 00:17 schrieb Max Cantor <Max.Cantor at Colorado.EDU>:
> 
> Hi all,
> 
> I used to be mcantor at umich.edu, now I'm max.cantor at colorado.edu, but I'm the same Max Cantor as before :).
> 
> That out of the way, here is my question:
> 
> In the these threads - 
> http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008308.html
> http://mailman.science.ru.nl/pipermail/fieldtrip/2012-June/005351.html
> 
> The issue of fieldtrip's ability to do low valued high pass filters is addressed, and I was successfully able to implement a a bpfilter of [0.1 50] hz using a filter order of 1, and I compared it to my new lab's eeglab pipeline's ERP for a given subject and was able to get a more or less identical output. However, it's been awhile since I've read some of the nitty gritty signal processing, and I forget what exactly this means or what the significance of it is.
> 
> Even though I was able to more or less replicate their current pipeline, I'd still like to understand what exactly setting the filter order is doing and what the significance of it may be. If anyone can explain this to me or set me in the right direction (a suggested chapter in Steve Luck or Matt Cohen's book, or a good article, for instance), I would greatly appreciate it. 
> 
> Thanks,
> 
> Max
> 
> -- 
> Max Cantor
> Graduate Student
> Cognitive Neuroscience of Language Lab
> University of Colorado Boulder
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip




From Max.Cantor at Colorado.EDU  Sat Sep 26 16:44:23 2015
From: Max.Cantor at Colorado.EDU (Max Cantor)
Date: Sat, 26 Sep 2015 08:44:23 -0600
Subject: [FieldTrip] Filter Order for High Pass Filter
In-Reply-To: <765DC6B0-4EE1-4D42-B3A6-91685DF1A8A6@uni-leipzig.de>
References: <CAOv1Hy2vVF2oYFVMHtm+hbA2-zXpgkapqFodzHnF_OA8Yp09RQ@mail.gmail.com>
 <765DC6B0-4EE1-4D42-B3A6-91685DF1A8A6@uni-leipzig.de>
Message-ID: <CAOv1Hy3p+PwizmBELOmp8wmYvMheGQOp=Nkc38c4wunuqkf8+g@mail.gmail.com>

Ok, I vaguely remembered that it had something to do with fieldtrip's
default filter, but I couldn't remember the specifics, thank you! I'll play
around with some other filter options and make sure I totally understand
what's happening, but I think between your explanation and the article
Vitoria recommended (which I still need to read but thank you!) I feel more
comfortable with my pipeline now. That being said, if anyone else has
further comments on the subject, further insight is always appreciated.

Thank you Andreas and Vitoria!

On Sat, Sep 26, 2015 at 3:04 AM, Andreas Widmann <widmann at uni-leipzig.de>
wrote:

> Hi Max,
>
> the filter order defines how steep or shallow the transition between
> passband and stopband is (in the frequency response). The higher the
> steeper.
>
> For the Fieldtrip default Butterworth IIR filter this is -6 dB/oct per
> order (the order is doubled internally due to forward and backward
> filtering, so actually -12 dB/oct per order). For extreme filters (0.1 Hz
> highpass) Butterworth filters sometimes have stability issues (accumulating
> rounding errors). There’s now a strategy implemented dealing with these
> cases iirc.
>
> The order of IIR and FIR filters must not be directly compared. For FIR
> filters the order is the impulse response length minus one. Thus, to
> compare IIR and FIR the impulse response length should be compared. The
> above Butterworth filter has an impulse response length of 7880 points to
> be doubled due to forward and backward filtering (-1; 15759 points). A
> corresponding FIR filter (500 Hz, Hamming window) only requires 8251
> points. As most EEG textbooks explicitly recommend shorter filters over
> longer filters you might want to consider applying a FIR filter (e.g.,
> cfg.hpfilttype = 'firws‘; cfg.hpfiltdir = 'onepass-zerophase';).
>
> Best,
> Andreas
>
> > Am 26.09.2015 um 00:17 schrieb Max Cantor <Max.Cantor at Colorado.EDU>:
> >
> > Hi all,
> >
> > I used to be mcantor at umich.edu, now I'm max.cantor at colorado.edu, but
> I'm the same Max Cantor as before :).
> >
> > That out of the way, here is my question:
> >
> > In the these threads -
> > http://mailman.science.ru.nl/pipermail/fieldtrip/2014-August/008308.html
> > http://mailman.science.ru.nl/pipermail/fieldtrip/2012-June/005351.html
> >
> > The issue of fieldtrip's ability to do low valued high pass filters is
> addressed, and I was successfully able to implement a a bpfilter of [0.1
> 50] hz using a filter order of 1, and I compared it to my new lab's eeglab
> pipeline's ERP for a given subject and was able to get a more or less
> identical output. However, it's been awhile since I've read some of the
> nitty gritty signal processing, and I forget what exactly this means or
> what the significance of it is.
> >
> > Even though I was able to more or less replicate their current pipeline,
> I'd still like to understand what exactly setting the filter order is doing
> and what the significance of it may be. If anyone can explain this to me or
> set me in the right direction (a suggested chapter in Steve Luck or Matt
> Cohen's book, or a good article, for instance), I would greatly appreciate
> it.
> >
> > Thanks,
> >
> > Max
> >
> > --
> > Max Cantor
> > Graduate Student
> > Cognitive Neuroscience of Language Lab
> > University of Colorado Boulder
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
>


-- 
Max Cantor
Graduate Student
Cognitive Neuroscience of Language Lab
University of Colorado Boulder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150926/d8a4c2ac/attachment.htm>

From bick35 at gmail.com  Sun Sep 27 08:15:13 2015
From: bick35 at gmail.com (Steph Bickel)
Date: Sat, 26 Sep 2015 23:15:13 -0700
Subject: [FieldTrip] data browser looking for missing cfg.headerformat
In-Reply-To: <C2A579D858882B47926827674B07F5015846C11A@KIMSX02.user.ki.se>
References: <A7786BFD-615F-409E-AAFC-3770D5D846BD@gmail.com>
 <C2A579D858882B47926827674B07F5015846C0FF@KIMSX02.user.ki.se>
 <C2A579D858882B47926827674B07F5015846C11A@KIMSX02.user.ki.se>
Message-ID: <47FB84EF-41F8-4AA9-9FBF-E1CB65C5A8E6@gmail.com>

Hi Stephen,

thanks for your response, and for spelling my name right :)

The call to ft_read_header happened in the call to ft_databrowser, it wasn’t directly called by me. 

But, in the meanwhile, I get passed that point when calling the data browser with cfg.dataset instead of cfg.datafile. 

However, I have a new error (see below). The data I am trying to plot is just continuous data that I did not perform any artifact rejection on. 

would you have an idea what’s going on? 

Thank you!

Stephan


 
cfg=[];
cfg.continuous = ‘yes’;
cfg.demean = ‘yes’;
raw = ft_preprocessing(cfg,filename)

>> cfg=[];
cfg.viewmode = 'vertical';
cfg.continuous ='yes';
% cfg.dataset = edf ;
ft_databrowser(cfg,raw)
the input is raw data with 105 channels and 1 trials
detected   0 visual artifacts
Error using zeros
Size inputs must be integers.

Error in convert_event>artifact2artvec (line 179)
artvec = zeros(length(artifact), endsample);

Error in convert_event (line 103)
    obj = artifact2artvec(obj,endsample);

Error in ft_databrowser (line 511)
artdata.trial{1}       = convert_event(artifact, 'boolvec', 'endsample', datendsample); % every artifact is a "channel"
 


> On Sep 25, 2015, at 12:12 AM, Stephen Whitmarsh <stephen.whitmarsh at ki.se> wrote:
> 
> Hi Stephan,
>  
> Sorry for misspelling your name – I know how it feels J
>  
> Stephen
>  
> From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Stephen Whitmarsh
> Sent: 25 September 2015 09:07
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] data browser looking for missing cfg.headerformat
>  
> Hi Stefan,
>  
> You haven’t defined the third argument you use in the call to ft_read_header, i.e. cfg.headerformat. You could change it to ‘edf’ I think, or just try to leave it out – pretty sure ft_read_header can figure out the dataformat.
>  
> Cheers,
> Stephen
>  
> From: fieldtrip-bounces at science.ru.nl <mailto:fieldtrip-bounces at science.ru.nl> [mailto:fieldtrip-bounces at science.ru.nl <mailto:fieldtrip-bounces at science.ru.nl>] On Behalf Of Steph Bickel
> Sent: 25 September 2015 06:20
> To: fieldtrip at science.ru.nl <mailto:fieldtrip at science.ru.nl>
> Subject: [FieldTrip] data browser looking for missing cfg.headerformat
>  
> Hello fieldtrip experts, 
>  
> I tried plotting an edf file. At line 325 the function ft_read_header seems to expect a field in the config structure that does not exist.
> Do you know if I am doing something wrong or if this is a bug?
>  
> I am using the current field trip version downloaded from github.
>  
> Thank you!
>  
> Stephan
>  
>  
> cfg=[];
> cfg.viewmode = 'vertical';
> cfg.continuous ='yes';
> cfg.datafile = ‘/data/test.edf';
> ft_databrowser(cfg)
>  
>  
> Reference to non-existent field 'headerformat'.
> Error in ft_databrowser (line 325)
>   hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat);
>  
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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

From bick35 at gmail.com  Sun Sep 27 08:54:21 2015
From: bick35 at gmail.com (Steph Bickel)
Date: Sat, 26 Sep 2015 23:54:21 -0700
Subject: [FieldTrip] ft_preprocessing ignores channel selection
Message-ID: <C3FC63CA-6F00-4FE0-A9F1-D64496819D3D@gmail.com>

Hello fieldtrip experts,

a script that used to work gives me problems now. 

When I specify subsets of channels to import it will correctly only import the selected label but in the trial field it will have all channels imported. 


cfg=[];
cfg.dataset =  edf_file ;
cfg.continuous = ‘yes’;
cfg.demean = ‘yes' ;
cfg.channel = ‘Event' ;
raw = ft_preprocessing(cfg);

raw = 

           hdr: [1x1 struct]
         label: {'Event'}
          time: {[1x152082 double]}
         trial: {[129x152082 double]}
       fsample: 499.7071
    sampleinfo: [1 152082]
           cfg: [1x1 struct]


It seems that read_edf.m is being called and at line 351 the chanindx is being overwritten by EDF.chansel (which is being read out of the edf header directly). Do I see this correctly or am I setting wrong parameters?


  if isfield(EDF, 'chansel')
      chanindx = EDF.chansel;
      chanSel = 1;
  else
      chanindx = [1:EDF.NS]; 
      chanSel = 0;
  end;



Thank you!

Stephan 

(I’m using the current github field trip version on a mac) 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150926/e7807e11/attachment.htm>

From jan.schoffelen at donders.ru.nl  Mon Sep 28 09:20:53 2015
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 28 Sep 2015 07:20:53 +0000
Subject: [FieldTrip] change orientation of MRI or source plot
In-Reply-To: <AA21F9F31911364596BE68CA1AAD8DA466E284DE@x10-mbx13.yu.yale.edu>
References: <AA21F9F31911364596BE68CA1AAD8DA466E284DE@x10-mbx13.yu.yale.edu>
Message-ID: <8BCA1231-DE0A-467F-9C99-682D1CC8A7CD@fcdonders.ru.nl>

If you want the anatomical image to be displayed exactly the same as the template image you need to do the following 2 things:

-call ft_volumerealign, and impose a RAS coordinate system.
-call ft_volumereslice, to align the i/j/k voxel axes with the x/y/z coordinate axes (which in the previous step were constructed to be RAS).

Best,
Jan-Mathijs



On Sep 25, 2015, at 4:46 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:

Hi,

I have a question about the orientation of MRI and source plot. I made the some comparison plot as below.
http://imgur.com/a/FoMAH

The top image is a plot of the T1template, which follows the convention that the top left is coronal, top right is sagittal and the bottom left is axial.

The bottom image is from Subject01.mri downloaded from the fieldtrip server and applied volumeslice. (Without using volumeslice the orientation is not correct either). The coronal and sagittal views were switched.

I'm wondering whether there is a way that I can change the orientation of the plot.

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

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

From nikadon at gmail.com  Mon Sep 28 15:16:24 2015
From: nikadon at gmail.com (Jan Nikadon)
Date: Mon, 28 Sep 2015 15:16:24 +0200
Subject: [FieldTrip] High norm and correlation between columns of some
 (exterior) leadfield nodes
Message-ID: <CAAxp5fwyw+=gvKtU2nUpsHmOPPxKm61DDxjw1ZPQfjCrNfQN7A@mail.gmail.com>

  Dear community,

  My name is Jan I am based at Nicolaus Copernicus University in Toruń
  (Poland), where I study CogSci, I am also member of small research
  group focused on on neuronal activity indices and reconstruction
  methods.  FieldTrip has turned out to be the most convenient and
  capable toolbox for the work we have done so far :)

  However, we have a question in respect of forward modelling.  We had
  a close look into some properties of leadfields and we are anxious
  if the features revealed are unusual, alarming or just standard and
  irrelevant?

  We have found that some leadfield nodes have norm (calculations
  described below) tremendously higher than the neighbouring nodes.
  Also some nodes are column-wise highly correlated.

  We obtained very similar results for both =icosahedron642= and
  random =sphere-like= triangulations.

  We have produced 2 volume conduction models and 2 corresponding
  leadfields that were based on =icosahedron642= or random
  =sphere-like meshes= geometry.  Radia for { 'brain' 'skull' 'scalp'
  } were [ 88 92 100 ].

  Electrodes (162, =icosahedron162=) were placed uniformly around the
  scalp All geometrical units were in mm.  Conductivity was expressed
  in in S/mm.

  We used =dipoli= and =openmeeg= methods with ft_prepare_headmodel






*  #+BEGIN_SRC matlab :eval no :exports code    cfg                 =
[];    cfg.method          = 'openmeeg';    cfg.conductivity    =
sel_msh02.cond    sel_vol02_openmeeg  = ft_prepare_headmodel( cfg,
sel_msh02.bnd );  #+END_SRC*

  and






*  #+BEGIN_SRC matlab :eval no :exports code    cfg                 =
[];    cfg.method          = 'dipoli';    cfg.conductivity    =
sel_msh02.cond    sel_vol02_dipoli    = ft_prepare_headmodel( cfg,
sel_msh02.bnd );  #+END_SRC*

  The laedfield was created using the following settings















*  #+BEGIN_SRC matlab :eval no :exports code    cfg                   =
[];    cfg.elec              = sel_elec00;    cfg.grid.unit         =
'mm';    cfg.grid.xgrid        = -110:5:110;       % Specify in mm!
cfg.grid.ygrid        = -110:5:110;       % Specify in mm!
cfg.grid.zgrid        = -110:5:110;       % Specify in mm!
cfg.reducerank        = 'no';    cfg.vol               =
sel_vol02_dipoli;    sel_lfg02_dipoli      = ft_prepare_leadfield(cfg);
cfg.vol               = sel_vol02_openmeeg;    sel_lfg02_openmeeg    =
ft_prepare_leadfield(cfg);  #+END_SRC*

** Norm

   Next, we plotted norm of the leadfields expressed as

   $norm(H) = sum(sum(abs(H)))$

   [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_712_leadfield-norms_openmeeg.png
]]

   On the figure above norm for OPENMEEG created leadfield is
   expressed by colour and marker size.  It is quite evident that
   leadfields with very high norm are distributed on the externals of
   the grid.

   [[file:img/fig_711_leadfield-norms_dipoli.png]]

   Same problem arises with DIPOLI leadfield, but to much smaller
   extent.  My it pose a serious threat to both spatial filters and
   some activity indices (such as power of LCMV filter).

   The following histograms also show the same feature of the
   leadfields.  Please note that the horizontal axis contains
   log(norm(H)) so the values spread is more dramatic than it appears
   at the first glace.

   [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_722_leadfield-normHist_openmeeg.png
]]

   [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_721_leadfield-normHist_dipoli.png
]]

** Correlation

   We also investigated correlation between columns of each leadfield
   node.  We suspect that this feature can also have deleterious efect
   on performance of some spatial filters and neuronal activity
   indices.

   Following scatterplots show this using color and marker size which
   reflect the absolute value of correlation coefficient between
   second and third column of each leadfield node (change of columns
   in consideration does not alleviate the problem.

   OPENMEEG
   [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_732_leadfield-corrCoefs_openmeeg.png
]]

   DIPOLI
   [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_731_leadfield-corrCoefs_dipoli.png
]]

** Differences between leadfields

   Futhermore we checked correlation between solutions provided by
   DIPOLI and OPENMEEG.  Here we calculated correlation coefficients
   between the two leadfield grids with respect to nodes of the same
   position inside the ``brain''.

   Following plot shows only leadfield nodes for which the absolute
   value of correlation coefficient was lower than 0.1.

   This shows that solutions for the nodes that are located deep
   inside brain are highly correlated.  The main differences between
   the leadfields are distributed at the exterior of the grid.

   [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_800_leadfield-corrCoefs-DIPOLI-vs-OPENMEEG.png
]]

** MATLAB figures

   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_666_triangulation-meshes.fig
]]
   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_700_electrode-positions-and-labels.fig
]]
   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_701_leadfield-geometry_dipoli.fig
]]
   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_702_leadfield-geometry_openmeeg.fig
]]
   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_711_leadfield-norms_dipoli.fig
]]
   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_712_leadfield-norms_openmeeg.fig
]]
   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_721_leadfield-normHist_dipoli.fig
]]
   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_722_leadfield-normHist_openmeeg.fig
]]
   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_731_leadfield-corrCoefs_dipoli.fig
]]
   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_732_leadfield-corrCoefs_openmeeg.fig
]]
   * [[
https://github.com/nikadon/lfgTesting001/blob/master/img/fig_800_leadfield-corrCoefs-DIPOLI-vs-OPENMEEG.fig
]]

   Details of the MATLAB implementation for the above can be found on
   https://github.com/nikadon/lfgTesting001/blob/master/lfgTesting001.org


   Thank you in advance for any help or comments...

   Best,
   Jan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150928/cf2e01b9/attachment.htm>

From jia.wu at yale.edu  Mon Sep 28 16:57:46 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Mon, 28 Sep 2015 14:57:46 +0000
Subject: [FieldTrip] change orientation of MRI or source plot
In-Reply-To: <8BCA1231-DE0A-467F-9C99-682D1CC8A7CD@fcdonders.ru.nl>
References: <AA21F9F31911364596BE68CA1AAD8DA466E284DE@x10-mbx13.yu.yale.edu>,
 <8BCA1231-DE0A-467F-9C99-682D1CC8A7CD@fcdonders.ru.nl>
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E30ADE@x10-mbx13.yu.yale.edu>

Jan-Mathijs,
Thank you very much for the note. I'm not sure how to impose a RAS coordinate system. I tried the following code and got an error. If you have  a quick moment do you mind pointing me to the right direction? Thank you so much!
-jia

Input:
cfg=[];
cfg.method='spm';
target = 'template/T1.nii';
ft_volumerealign(cfg,mri,target);

Output:
the input is volume data with dimensions [256 256 256]
Warning: defaulting to  coordinate system
> In ft_volumerealign (line 238)
Input volume has coordinate system 'ctf'
Error using ft_convert_units (line 142)
cannot determine geometrical units

Error in ft_determine_coordsys (line 55)
data  = ft_convert_units(data);

Error in ft_convert_coordsys (line 59)
  obj = ft_determine_coordsys(obj, 'interactive', 'yes');

Error in ft_volumerealign (line 827)
      target = ft_convert_coordsys(target);


________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl]
Sent: Monday, September 28, 2015 3:20 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] change orientation of MRI or source plot

If you want the anatomical image to be displayed exactly the same as the template image you need to do the following 2 things:

-call ft_volumerealign, and impose a RAS coordinate system.
-call ft_volumereslice, to align the i/j/k voxel axes with the x/y/z coordinate axes (which in the previous step were constructed to be RAS).

Best,
Jan-Mathijs



On Sep 25, 2015, at 4:46 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:

Hi,

I have a question about the orientation of MRI and source plot. I made the some comparison plot as below.
http://imgur.com/a/FoMAH<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_a_FoMAH&d=AwMFAw&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=zO_2mE8ZYtGGWpMORuQp1nczgv9nyCvAMO2hB87pvOE&s=_D8VLWPcGCa0JhIGjF07gXmcf7jXMhXdzO2ZcpuMrwM&e=>

The top image is a plot of the T1template, which follows the convention that the top left is coronal, top right is sagittal and the bottom left is axial.

The bottom image is from Subject01.mri downloaded from the fieldtrip server and applied volumeslice. (Without using volumeslice the orientation is not correct either). The coronal and sagittal views were switched.

I'm wondering whether there is a way that I can change the orientation of the plot.

best,
-jia
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFAw&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=zO_2mE8ZYtGGWpMORuQp1nczgv9nyCvAMO2hB87pvOE&s=ax2Y-_AsQyRp9juX7DFVHwFlLb95AQ5w13xAWfKpV8Q&e=>

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

From jia.wu at yale.edu  Mon Sep 28 16:59:29 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Mon, 28 Sep 2015 14:59:29 +0000
Subject: [FieldTrip] change orientation of MRI or source plot
In-Reply-To: <8B216DA7-B5AC-421D-AC80-4EFC03E95884@uni-konstanz.de>
References: <AA21F9F31911364596BE68CA1AAD8DA466E284DE@x10-mbx13.yu.yale.edu>,
 <8B216DA7-B5AC-421D-AC80-4EFC03E95884@uni-konstanz.de>
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E30AE9@x10-mbx13.yu.yale.edu>

tzvetan,
Thanks for answering my question. It always feels you are not alone when someone gets back. I tried volumeslice but it put the top two images in the opposite way as of fMRI software. That's why I'm trying to find a way to adjust it.
best,
-jia
________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Tzvetan Popov [tzvetan.popov at uni-konstanz.de]
Sent: Friday, September 25, 2015 1:44 PM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] change orientation of MRI or source plot

Hi Jia,
yes there is a way. Please have a look at this FAQ:
http://www.fieldtriptoolbox.org/faq/my_mri_is_upside_down_is_this_a_problem<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_faq_my-5Fmri-5Fis-5Fupside-5Fdown-5Fis-5Fthis-5Fa-5Fproblem&d=AwMFAw&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=LsSeANE6z-FR6WnQgqKv5Xyp1s1Rs_XBwv8rvweeaf0&s=59qfkkMmKW-JtOLNYr53OzdtSfPF6VMuCZa3Vxgi2pM&e=>

and also this one: http://www.fieldtriptoolbox.org/faq/how_change_mri_orientation_size_fov<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.fieldtriptoolbox.org_faq_how-5Fchange-5Fmri-5Forientation-5Fsize-5Ffov&d=AwMFAw&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=LsSeANE6z-FR6WnQgqKv5Xyp1s1Rs_XBwv8rvweeaf0&s=2oZafKPueFUgK8VwhnBRzTFLtAwyvv6z6q4PCeiNhgU&e=>
Good luck,
tzvetan


Hi,

I have a question about the orientation of MRI and source plot. I made the some comparison plot as below.
http://imgur.com/a/FoMAH<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_a_FoMAH&d=AwMFAw&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=LsSeANE6z-FR6WnQgqKv5Xyp1s1Rs_XBwv8rvweeaf0&s=jQMLgXsH5b8Bz-GTuRNuIPkPJnnQHqRxdmPk49q6iS0&e=>

The top image is a plot of the T1template, which follows the convention that the top left is coronal, top right is sagittal and the bottom left is axial.

The bottom image is from Subject01.mri downloaded from the fieldtrip server and applied volumeslice. (Without using volumeslice the orientation is not correct either). The coronal and sagittal views were switched.

I'm wondering whether there is a way that I can change the orientation of the plot.

best,
-jia
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFAw&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=LsSeANE6z-FR6WnQgqKv5Xyp1s1Rs_XBwv8rvweeaf0&s=-b8uejzt5YBzyp1h9B6R6zluHNmCaOFuKVlqFKvh5Aw&e=>

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

From jan.schoffelen at donders.ru.nl  Mon Sep 28 17:29:23 2015
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Mon, 28 Sep 2015 15:29:23 +0000
Subject: [FieldTrip] change orientation of MRI or source plot
In-Reply-To: <AA21F9F31911364596BE68CA1AAD8DA466E30ADE@x10-mbx13.yu.yale.edu>
References: <AA21F9F31911364596BE68CA1AAD8DA466E284DE@x10-mbx13.yu.yale.edu>, 
 <8BCA1231-DE0A-467F-9C99-682D1CC8A7CD@fcdonders.ru.nl>
 <AA21F9F31911364596BE68CA1AAD8DA466E30ADE@x10-mbx13.yu.yale.edu>
Message-ID: <05FD8E12-6A4B-4F71-9A8D-3884CBAD13D0@fcdonders.ru.nl>

Hi Jia,

RAS is just shorthand for a coordinate system that uses a convention where the X,Y and Z axes of the coordinate system (relative to a meaningful object, in our case: the brain) is pointing to the right, anterior and superior respectively. In order to define the anatomical image in a RAS coordinate system, you should call ft_volumerealign with one of the two following inputs:

case 1):

cfg = [];
cfg.method = ‘interactive’;
cfg.coordsys = ‘neuromag’;
mri = ft_volumerealign(cfg, mri);

then you can click around in the volume, and define the lpa,rpa and nasion fiducials (with the l,r, and n keys)

case 2):

cfg = [];
cfg.method = ‘interactive’;
mri = ft_volumerealign(cfg, mri);

if you now click around, you can define the anterior commissure, the posterior commissure, and a point along the positive z-axis, and a point along the positive x-axis (with, respectively, the keys a, p, z and r).

Either way, you’ll result in an anatomical image that has an RAS-coordinate system (yet both with different origins, as defined and described in the documentation that Tzvetan pointed you to), and I assume that you are after the ‘SPM’-based coordinate system, which uses the anatomical landmarks (anterior and posterior commissures to define the origin and the direction of the y-axis).

Next, you can call ft_volumereslice to align the cardinal voxel axes to the axes of your RAS coordinate system.

As an explanatory note, CTF uses a so-called ALS coordinate system, wher the X-axis points to anterior, the Y axis to the left, and the Z-axis to the top of the head. On the screen, after a ft_volumereslice, this gives a picture with a 90 degree rotation around the z-axis, because the physical interpretation of the x and y axes are different (‘RA' versus ‘AL’).

I realize that there is also a case 3 that you can do, which does not require an interactive step:

case 3):

cfg = [];
cfg.nonlinear = ‘no’;
mrin = ft_volumenormalise(cfg, mri);
mrir = ft_volumereslice([],mrin);

If you call ft_volumenormalise with cfg.nonlinear = ‘no’, the affine transformation is estimated that goes from voxel space to a RAS coordinate system with the origin in the anterior commissure (approximately). This should be more or less equivalent to case 2) above.

Best,
Jan-Mathijs



On Sep 28, 2015, at 4:57 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:

Jan-Mathijs,
Thank you very much for the note. I'm not sure how to impose a RAS coordinate system. I tried the following code and got an error. If you have  a quick moment do you mind pointing me to the right direction? Thank you so much!
-jia

Input:
cfg=[];
cfg.method='spm';
target = 'template/T1.nii';
ft_volumerealign(cfg,mri,target);

Output:
the input is volume data with dimensions [256 256 256]
Warning: defaulting to  coordinate system
> In ft_volumerealign (line 238)
Input volume has coordinate system 'ctf'
Error using ft_convert_units (line 142)
cannot determine geometrical units

Error in ft_determine_coordsys (line 55)
data  = ft_convert_units(data);

Error in ft_convert_coordsys (line 59)
  obj = ft_determine_coordsys(obj, 'interactive', 'yes');

Error in ft_volumerealign (line 827)
      target = ft_convert_coordsys(target);


________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Schoffelen, J.M. (Jan Mathijs) [jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>]
Sent: Monday, September 28, 2015 3:20 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] change orientation of MRI or source plot

If you want the anatomical image to be displayed exactly the same as the template image you need to do the following 2 things:

-call ft_volumerealign, and impose a RAS coordinate system.
-call ft_volumereslice, to align the i/j/k voxel axes with the x/y/z coordinate axes (which in the previous step were constructed to be RAS).

Best,
Jan-Mathijs



On Sep 25, 2015, at 4:46 PM, Wu, Jia <jia.wu at yale.edu<mailto:jia.wu at yale.edu>> wrote:

Hi,

I have a question about the orientation of MRI and source plot. I made the some comparison plot as below.
http://imgur.com/a/FoMAH<https://urldefense.proofpoint.com/v2/url?u=http-3A__imgur.com_a_FoMAH&d=AwMFAw&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=zO_2mE8ZYtGGWpMORuQp1nczgv9nyCvAMO2hB87pvOE&s=_D8VLWPcGCa0JhIGjF07gXmcf7jXMhXdzO2ZcpuMrwM&e=>

The top image is a plot of the T1template, which follows the convention that the top left is coronal, top right is sagittal and the bottom left is axial.

The bottom image is from Subject01.mri downloaded from the fieldtrip server and applied volumeslice. (Without using volumeslice the orientation is not correct either). The coronal and sagittal views were switched.

I'm wondering whether there is a way that I can change the orientation of the plot.

best,
-jia
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwMFAw&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=zO_2mE8ZYtGGWpMORuQp1nczgv9nyCvAMO2hB87pvOE&s=ax2Y-_AsQyRp9juX7DFVHwFlLb95AQ5w13xAWfKpV8Q&e=>

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

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

From s.aurtenetxe at bcbl.eu  Tue Sep 29 17:27:57 2015
From: s.aurtenetxe at bcbl.eu (Sara Aurtenetxe)
Date: Tue, 29 Sep 2015 17:27:57 +0200 (CEST)
Subject: [FieldTrip] Interpolate, normalise and sourcegrandaverage with MNE
Message-ID: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu>

Dear all, 

I am working on the source analysis of ERF data from ElektaNeuromag system, with individual T1s, using minimum-norm estimate as described in the following tutorial:
http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate
I am exactly following the suggested steps, and so got the source estimation for each of my subjects (bellow the output for one subject), which i can nicely plot with the ft_plot_mesh function:

sourceest = 

      time: [1x1401 double]
    inside: [8196x1 logical]
       pos: [8196x3 double]
    method: 'average'
       avg: [1x1 struct]
       cfg: [1x1 struct] 

Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, 
I am trying to normalise (ft_volumenormalise) and interpolate (ft_sourceinterpolate) the functional and anatomical data. 

However, I am struggling in this two last steps. 
Since I did not find a clear pipeline/tutorial about the exact approach (am I missing something?) 
and after trying several options (bellow I copy the code I am using), it is not clear to me:

- which is the exact input data for each of these last two functions, and
- in which order they should be called.

Now, I would highly appreciate if anyone could give me any cue about which the correct approach is.

Thank you in advance, 

All the best,

Sara



%%%%%%%%%%%%

% Inverse solution
cfg        = [];
cfg.method = 'mne';
cfg.grid   = leadfield;
cfg.vol    = vol;
cfg.mne.prewhiten = 'yes';
cfg.mne.lambda    = 3;
cfg.mne.scalesourcecov = 'yes';
cfg.senstype = 'MEG';
    
sourceest  = ft_sourceanalysis(cfg,erf);

% read T1 volume - coords in scanner space
mri = ft_read_mri('s01.nii');
mri.coordsys = 'neuromag';

% read headshape - Neuromag coords
hsf = 's01.fif';
[headshape] = ft_read_headshape(hsf);

% align T1 with head posiiton in MEG
cfg = [];
cfg.method = 'headshape';
cfg.parameter      = 'anatomy';
cfg.headshape.headshape = headshape;
cfg.headshape.interactive = 'no';

mri_real = ft_volumerealign(cfg,mri);

% normalize the realinged individual MRI to SPM template
cfg = [];
cfg.spmversion  = 'spm8';
 % cfg.template='T1.nii'; % when enabling this field, an incoming error message indicates that the template is not in the spm coordinate system. 
                          % However, is the one used by default in this function (as mentioned in the reference) so it is confusing to me

norm_mri = ft_volumenormalise(cfg,mri_real);

% interpolate Source with MEG-aligned T1
cfg            = [];
cfg.parameter = 'all';
cfg.downsample = 2;

source_int  = ft_sourceinterpolate(cfg, sourceest,norm_mri);

%%%%%%%%%%%%%%




From russgport at gmail.com  Wed Sep 30 04:54:22 2015
From: russgport at gmail.com (russ port)
Date: Tue, 29 Sep 2015 22:54:22 -0400
Subject: [FieldTrip] unit gain for Fieldtrip's LCMV beamformer - unit
In-Reply-To: <2A2B6A5B8C4C174CBCCE0B45E548DEB22A0D8A9B@SKMBXX01.sickkids.ca>
References: <2A2B6A5B8C4C174CBCCE0B45E548DEB22A0D8A9B@SKMBXX01.sickkids.ca>
Message-ID: <EA0E0226-F52F-49D0-95CE-24C34DBCBA7C@gmail.com>

Thanks Marc,

Sorry for taking so long to respond. I am quite confused now. I think I get what you are talking about with "unit gain" and "unit noise-gain” as defined by Sekihara, as much as I can make out at least with out having the book you refer to (on the bright side I now know what to nag my boss for). I suppose I was a quite mis-leading with what I had in my last email, by which, what I actually did was use the LCMV beamformer to make lead fields to calculate the virtual sensors (see http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors <http://www.fieldtriptoolbox.org/tutorial/shared/virtual_sensors>). Of note, your link to the discussion list is now even more useful. I am using centimeters and a single shell head model. The wiki says "CMV beamformer spatial filter for the location of interest will pass the activity at that location with unit-gain”. From your email, I suspect then that the output would be in Am units. I am a little concerned though that both my output, and the field trip wiki shows values ranging ~ -3 -> 3 (e-4, i.e. mAm not nAm). Or instead would the units be in T/(Am) (if I apply the 1e4 unit conversion). Sorry for not being better at this, I think I do need those books you were mentioning...

Best,
Russ





> On Sep 11, 2015, at 12:40 PM, Marc Lalancette <marc.lalancette at sickkids.ca> wrote:
> 
> mformer with unit gain would have Am units.

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

From jan.schoffelen at donders.ru.nl  Wed Sep 30 09:33:03 2015
From: jan.schoffelen at donders.ru.nl (Schoffelen, J.M. (Jan Mathijs))
Date: Wed, 30 Sep 2015 07:33:03 +0000
Subject: [FieldTrip] Interpolate,
 normalise and sourcegrandaverage with MNE
In-Reply-To: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu>
References: <1486560520.189349.1443540477564.JavaMail.zimbra@bcbl.eu>
Message-ID: <9C251048-0222-4011-89F7-574762210BC5@fcdonders.ru.nl>

Hi Sara,

I think that in this case there is no absolutely ‘correct’ approach, although some approaches may make more sense than others.
At this point in time it is indeed not well documented how to proceed from individual subject results source-reconstructed onto an individual cortically constrained mesh to a group analysis.
In the past, we have been working with a procedure where the surface data were interpolated onto a 3D-grid so that we could use volumetric normalization techniques in order to get the subjects into a common space to allow for group statistics. So, here the order of the steps would be to call ft_sourceinterpolate, followed by ft_volumenormalise, or to interpolate the functional data directly onto a MNI-warped grid (http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space).
In the code you pasted in your e-mail message, there is also reference to ft_volumerealign, but I am not sure I understand why this is a required step at this point in the pipeline.

All the above being said, nowadays I would advocate a slightly different approach, which bypasses the volumetric interpolation, where per subject I would use cortical meshes that is surface-registered to a template mesh, which as a consequence allows for direct comparison of source locations across subjects. The way to achieve this would be to post-process the surfaces that come out of the freesurfer pipeline according to the recipe described on http://brainvis.wustl.edu/wiki/index.php/Caret:Operations/Freesurfer_to_fs_LR. After this registration step, the low-resolution (i.e. in this case the 8196-vertex) meshes can be created.

Best wishes,
Jan-Mathijs




Jan-Mathijs Schoffelen, MD PhD, Senior researcher

Max Planck Institute for Psycholinguistics
Donders Centre for Cognitive Neuroimaging

E-mail: j.schoffelen at donders.ru.nl
Telephone: +31-24-3614793

http://www.fieldtriptoolbox.org
http://www.hettaligebrein.nl



On Sep 29, 2015, at 5:27 PM, Sara Aurtenetxe <s.aurtenetxe at bcbl.eu> wrote:

> Dear all, 
> 
> I am working on the source analysis of ERF data from ElektaNeuromag system, with individual T1s, using minimum-norm estimate as described in the following tutorial:
> http://www.fieldtriptoolbox.org/tutorial/minimumnormestimate
> I am exactly following the suggested steps, and so got the source estimation for each of my subjects (bellow the output for one subject), which i can nicely plot with the ft_plot_mesh function:
> 
> sourceest = 
> 
>      time: [1x1401 double]
>    inside: [8196x1 logical]
>       pos: [8196x3 double]
>    method: 'average'
>       avg: [1x1 struct]
>       cfg: [1x1 struct] 
> 
> Now, prior to a ft_sourcegrandaverage and ft_sourcestatistics, 
> I am trying to normalise (ft_volumenormalise) and interpolate (ft_sourceinterpolate) the functional and anatomical data. 
> 
> However, I am struggling in this two last steps. 
> Since I did not find a clear pipeline/tutorial about the exact approach (am I missing something?) 
> and after trying several options (bellow I copy the code I am using), it is not clear to me:
> 
> - which is the exact input data for each of these last two functions, and
> - in which order they should be called.
> 
> Now, I would highly appreciate if anyone could give me any cue about which the correct approach is.
> 
> Thank you in advance, 
> 
> All the best,
> 
> Sara
> 
> 
> 
> %%%%%%%%%%%%
> 
> % Inverse solution
> cfg        = [];
> cfg.method = 'mne';
> cfg.grid   = leadfield;
> cfg.vol    = vol;
> cfg.mne.prewhiten = 'yes';
> cfg.mne.lambda    = 3;
> cfg.mne.scalesourcecov = 'yes';
> cfg.senstype = 'MEG';
> 
> sourceest  = ft_sourceanalysis(cfg,erf);
> 
> % read T1 volume - coords in scanner space
> mri = ft_read_mri('s01.nii');
> mri.coordsys = 'neuromag';
> 
> % read headshape - Neuromag coords
> hsf = 's01.fif';
> [headshape] = ft_read_headshape(hsf);
> 
> % align T1 with head posiiton in MEG
> cfg = [];
> cfg.method = 'headshape';
> cfg.parameter      = 'anatomy';
> cfg.headshape.headshape = headshape;
> cfg.headshape.interactive = 'no';
> 
> mri_real = ft_volumerealign(cfg,mri);
> 
> % normalize the realinged individual MRI to SPM template
> cfg = [];
> cfg.spmversion  = 'spm8';
> % cfg.template='T1.nii'; % when enabling this field, an incoming error message indicates that the template is not in the spm coordinate system. 
>                          % However, is the one used by default in this function (as mentioned in the reference) so it is confusing to me
> 
> norm_mri = ft_volumenormalise(cfg,mri_real);
> 
> % interpolate Source with MEG-aligned T1
> cfg            = [];
> cfg.parameter = 'all';
> cfg.downsample = 2;
> 
> source_int  = ft_sourceinterpolate(cfg, sourceest,norm_mri);
> 
> %%%%%%%%%%%%%%
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip





From federica.ma at gmail.com  Wed Sep 30 15:31:56 2015
From: federica.ma at gmail.com (Federica Mauro)
Date: Wed, 30 Sep 2015 15:31:56 +0200
Subject: [FieldTrip] Artifact rejection
Message-ID: <CABX-y5AfeiuZKc=njGEXgZnNm58dfEFbo=UvsNRV8KEj2Ei-ww@mail.gmail.com>

Hi everybody,

I'm trying to use Fieldtrip in order to reject automatically artifacts on
my dataset. I'm working with EEG data previously preprocessed in EEGLAB,
thus their extension is .set.
I'm tryng to follow and adapt the tutorial for MEG data at
http://www.fieldtriptoolbox.org/tutorial/automatic_artifact_rejection, but
I found some problems.

1. It doesn't recognize assignment cfg.trl = trl. For this reason I tried
to use ft_definetrial in order to get the matrix cfg.trl, but it still
gives me problems:
2. Specifically: Error using ==> ft_read_data at 206 - cannot read data
before the begin of the file

Do you have any suggestion?

Thank you very much in advance!
Best,
Federica
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150930/6334301d/attachment.htm>

From matt.gerhold at gmail.com  Wed Sep 30 16:29:07 2015
From: matt.gerhold at gmail.com (Matt Gerhold)
Date: Wed, 30 Sep 2015 16:29:07 +0200
Subject: [FieldTrip] AR ITC
Message-ID: <CAH+a9OHXGMUvkv0VrFSyn=8Gs8Zj35BbS+43eaWk9+bXoORwiw@mail.gmail.com>

Hi,

Is there a way in FieldTrip to compute inter-trial phase-locking values for
an autoregressive model (EEG event-related analysis) and work with this
data as a time-frequency representation?

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

From jia.wu at yale.edu  Wed Sep 30 16:54:32 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Wed, 30 Sep 2015 14:54:32 +0000
Subject: [FieldTrip] ft_sourcegrandaverage
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E31C5E@x10-mbx13.yu.yale.edu>

Hi,

If I have 100 subjects, do I have to do:
grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)?

Is there a better way? Or is it not what I should be doing?

best,
-jia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150930/0eac4905/attachment.htm>

From eelke.spaak at donders.ru.nl  Wed Sep 30 17:04:00 2015
From: eelke.spaak at donders.ru.nl (Eelke Spaak)
Date: Wed, 30 Sep 2015 16:04:00 +0100
Subject: [FieldTrip] ft_sourcegrandaverage
In-Reply-To: <e9024e6223cb412f8ac2dc84565f3b15@EXPRD03.hosting.ru.nl>
References: <e9024e6223cb412f8ac2dc84565f3b15@EXPRD03.hosting.ru.nl>
Message-ID: <CABPNLUrtw53hS+0PEGwRpZ5JdV5gQtGvk8b271N-UDE_YG=iqg@mail.gmail.com>

Hi Jia,

In principle: yes, that is what you should be doing. However, Matlab
provides some nice 'syntactic sugar' to achieve this much more easily
than typing it all in 'by hand'.

If you have collected your subjects in one big cell array [1]:

allsubj = {};
allsubj{1} = data_subj1;
allsubj{2} = data_subj2;
...

then you can use a (somewhat peculiar) Matlab syntax known as a
'comma-separated list' [2] (yes, the name of that syntax sounds pretty
intuitive, but intuitions are a bit deceiving here):

grandavg = ft_sourcegrandaverage(cfg, allsubj{:});

Hope that helps.

Best,
Eelke

[1] http://uk.mathworks.com/help/matlab/cell-arrays.html
[2] http://uk.mathworks.com/help/matlab/matlab_prog/comma-separated-lists.html

On 30 September 2015 at 15:54, Wu, Jia <jia.wu at yale.edu> wrote:
> Hi,
>
> If I have 100 subjects, do I have to do:
> grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)?
>
> Is there a better way? Or is it not what I should be doing?
>
> best,
> -jia


From jia.wu at yale.edu  Wed Sep 30 18:32:23 2015
From: jia.wu at yale.edu (Wu, Jia)
Date: Wed, 30 Sep 2015 16:32:23 +0000
Subject: [FieldTrip] ft_sourcegrandaverage
In-Reply-To: <CABPNLUrtw53hS+0PEGwRpZ5JdV5gQtGvk8b271N-UDE_YG=iqg@mail.gmail.com>
References: <e9024e6223cb412f8ac2dc84565f3b15@EXPRD03.hosting.ru.nl>,
 <CABPNLUrtw53hS+0PEGwRpZ5JdV5gQtGvk8b271N-UDE_YG=iqg@mail.gmail.com>
Message-ID: <AA21F9F31911364596BE68CA1AAD8DA466E31C92@x10-mbx13.yu.yale.edu>

Eelke,
It works. Thank you very much!
-jia
________________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl]
Sent: Wednesday, September 30, 2015 11:04 AM
To: FieldTrip discussion list
Subject: Re: [FieldTrip] ft_sourcegrandaverage

Hi Jia,

In principle: yes, that is what you should be doing. However, Matlab
provides some nice 'syntactic sugar' to achieve this much more easily
than typing it all in 'by hand'.

If you have collected your subjects in one big cell array [1]:

allsubj = {};
allsubj{1} = data_subj1;
allsubj{2} = data_subj2;
...

then you can use a (somewhat peculiar) Matlab syntax known as a
'comma-separated list' [2] (yes, the name of that syntax sounds pretty
intuitive, but intuitions are a bit deceiving here):

grandavg = ft_sourcegrandaverage(cfg, allsubj{:});

Hope that helps.

Best,
Eelke

[1] https://urldefense.proofpoint.com/v2/url?u=http-3A__uk.mathworks.com_help_matlab_cell-2Darrays.html&d=AwICAg&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=QGgii5kqByUq8awFQC0e7zYkGaJ5KyXZh3Ujg74IpK8&s=oO3lBSzSq6z62jjZXXa9C1toX4uvQQAXINKWwUKyVqM&e=
[2] https://urldefense.proofpoint.com/v2/url?u=http-3A__uk.mathworks.com_help_matlab_matlab-5Fprog_comma-2Dseparated-2Dlists.html&d=AwICAg&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=QGgii5kqByUq8awFQC0e7zYkGaJ5KyXZh3Ujg74IpK8&s=EMBuE99bxhWTpA8Rb1cQ4TUcgfskde3AGPrGmw1XXYo&e=

On 30 September 2015 at 15:54, Wu, Jia <jia.wu at yale.edu> wrote:
> Hi,
>
> If I have 100 subjects, do I have to do:
> grandavg = ft_sourcegrandaverage(cfg,s1,s2,s3,s4,s5,s6........s100)?
>
> Is there a better way? Or is it not what I should be doing?
>
> best,
> -jia
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl
https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AwICAg&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=9ehCplyXHP0-m9ayYv1FOg&m=QGgii5kqByUq8awFQC0e7zYkGaJ5KyXZh3Ujg74IpK8&s=IqjJzNewlu4LDvzK-F6JHX9XuFSjTAJfSvx-KKHPTvA&e=



