From a.wollbrink at UNI-MUENSTER.DE  Thu Apr  1 16:50:25 2010
From: a.wollbrink at UNI-MUENSTER.DE (Andreas Wollbrink)
Date: Thu, 1 Apr 2010 16:50:25 +0200
Subject: using ft_sourcegrandaverage with spatio-temporal source
 reconstructions
Message-ID: <THU.1.APR.2010.165025.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi,

I have a question concerning the usage of ft_sourcegrandaverage:

Feeding the sourcegrandaverage function with spatio-temporal source
reconstructions (MNE) resulted in the following error message:

??? Subscripted assignment dimension mismatch.

Error in ==> ft_sourcegrandaverage at 126
   dat(:,i) = tmp(:);

Error in ==> sourcegrandaverage at 17
[varargout{1:nargout}] = funhandle(varargin{:});


I used the following settings:

cfg = [];
cfg.parameter = 'pow';
cfg.keepindividual = 'yes';

and called

sourcegrandaverage(cfg, src1, src2)

The two source reconstructions I generated using ft_sourceanalysis. The
matrix src1.avg.pow is two dimensional [Nsources x Nsamples].

Looking into the code (ft_sourcegrandaverage at 126) this seems to be
the problem.

By diminishing the source power matrix (avg.pow) to one dimension
(Nsources) I succedded using sourcegrandaverage.
To perform a source statistic later on it would be nice to have the
option to include time information as well (e.g. like in
timelockstatistics).

Please let me know whether generally it is impossible to use
spatio-temporal solutions in sourcegrandaverage (and sourcestatistics).

Thanks,
Andreas
--


======================================================================

   Andreas Wollbrink, Biomedical Engineer

   Institute for Biomagnetism and Biosignalanalysis       	
   Muenster University Hospital

   Malmedyweg 15        phone:   +49-(0)251-83-52546
   D-48149 Muenster     fax:     +49-(0)251-83-56874	
   Germany
                        e-Mail: a.wollbrink at uni-muenster.de

======================================================================

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From aardesta at UCLA.EDU  Thu Apr  1 21:41:56 2010
From: aardesta at UCLA.EDU (Allen Ardestani)
Date: Thu, 1 Apr 2010 12:41:56 -0700
Subject: New FieldTrip User Questions
Message-ID: <THU.1.APR.2010.124156.0700.FIELDTRIP@NIC.SURFNET.NL>

Hello,

I just now came across the FieldTrip toolbox and have a few questions - I
apologize in advance if I am misusing this discussion forum or if my
questions are too obvious.  I am working with a very large dataset of
simultaneous LFP, unit, and NIRS signal from macaques for the purpose of
examining time and frequency dynamics of the signals in various cognitive
conditions.  I would like to implement the clustering/bootstrapping
methodology outlined in [Journal of Neuroscience Methods 164 (2007) 177-190]
to identify significant changes in synchronization and phase-locking.



The specific data in question are LFPs recorded while the monkeys perform a
working-memory task, which consists of a 2s visual sample, 20s delay, and
subsequent choice period.  A 20s baseline precedes the sample (t=0), which
is time-locked to the animal's foveation on the visual sample.  TF plots are
computed using Morlet wavelets for each trial, averaged across trials, and
then normalized with respect to the average baseline.  The first question
I'd like to address is: what time-frequency regions exhibit significant
difference between Correct (left plot) and Incorrect (right plot) trials.



cid:image002.jpg at 01CAA0E0.B7CEC3E0 cid:image003.jpg at 01CAA0E0.B7CEC3E0

I have a number of questions about the appropriateness of applying
bootstrapping to our specific dataset:

1)      Because we use wavelets for spectral decomposition (with
frequency-dependent changes in spectral and temporal resolution) is it valid
to simply cluster across different frequencies?

2)      We are interested in comparing different conditions, where each is
computed relative to its own baseline.  Is there anything wrong with using
the baselines of the same dataset for the null distribution as opposed to
using a different set of baseline data?

3)      The data have been recorded at 1KHz, and this oversampling results
in high spatial-frequency noise.  Do I need to do any downsampling/smoothing
before applying the statistics?

4)      For evaluating the relationship between channels, we compute the
phase-locking value (PLV), which has no meaningful single-trial
measuremetnt.  Is there any way to apply statistical analyses directly to
the average TF plots without resorting back to the individual trials?



Thank you in advance for your help!



____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA




----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100401/250f649e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 18296 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100401/250f649e/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 17871 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100401/250f649e/attachment-0001.jpg>

From e.maris at DONDERS.RU.NL  Thu Apr  1 22:50:40 2010
From: e.maris at DONDERS.RU.NL (Eric Maris)
Date: Thu, 1 Apr 2010 22:50:40 +0200
Subject: New FieldTrip User Questions
In-Reply-To: <080001cad1d3$6348a3d0$29d9eb70$@edu>
Message-ID: <THU.1.APR.2010.225040.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Allen,



I just now came across the FieldTrip toolbox and have a few questions - I
apologize in advance if I am misusing this discussion forum or if my
questions are too obvious.  I am working with a very large dataset of
simultaneous LFP, unit, and NIRS signal from macaques for the purpose of
examining time and frequency dynamics of the signals in various cognitive
conditions.  I would like to implement the clustering/bootstrapping
methodology outlined in [Journal of Neuroscience Methods 164 (2007) 177-190]
to identify significant changes in synchronization and phase-locking.



The specific data in question are LFPs recorded while the monkeys perform a
working-memory task, which consists of a 2s visual sample, 20s delay, and
subsequent choice period.  A 20s baseline precedes the sample (t=0), which
is time-locked to the animal's foveation on the visual sample.  TF plots are
computed using Morlet wavelets for each trial, averaged across trials, and
then normalized with respect to the average baseline.  The first question
I'd like to address is: what time-frequency regions exhibit significant
difference between Correct (left plot) and Incorrect (right plot) trials.



cid:image002.jpg at 01CAA0E0.B7CEC3E0 cid:image003.jpg at 01CAA0E0.B7CEC3E0

I have a number of questions about the appropriateness of applying
bootstrapping to our specific dataset:

1)      Because we use wavelets for spectral decomposition (with
frequency-dependent changes in spectral and temporal resolution) is it valid
to simply cluster across different frequencies?



Yes it is. However, with your 20 sec. trials, I would not go for the high
temporal resolution that he wavelet transform gives you. I would do one
Fourier-based analyses for the first 2 seconds (encoding stage) and another
one for the rest of the trial (retention stage).



2)      We are interested in comparing different conditions, where each is
computed relative to its own baseline.  Is there anything wrong with using
the baselines of the same dataset for the null distribution as opposed to
using a different set of baseline data?



Do not baseline correct your data. Compare the raw power spectra for the
correct response trials with those of the incorrect response condition.



3)      The data have been recorded at 1KHz, and this oversampling results
in high spatial-frequency noise.  Do I need to do any downsampling/smoothing
before applying the statistics?





No. However, with such long trials, I would definitely smooth in the
frequency domain using multitapers (also available in Fieldtrip).





4)      For evaluating the relationship between channels, we compute the
phase-locking value (PLV), which has no meaningful single-trial
measuremetnt.  Is there any way to apply statistical analyses directly to
the average TF plots without resorting back to the individual trials?



Have look at the paper by Maris, Schoffelen, and Fries (2007, JNM) that
describes cluster-based permutation tests for coherence differences. This
may be what you need.







Best,

















____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100401/251e7fa6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 18296 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100401/251e7fa6/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 17871 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100401/251e7fa6/attachment-0001.jpg>

From zd8472 at GMAIL.COM  Tue Apr  6 10:13:00 2010
From: zd8472 at GMAIL.COM (Dan Zhang)
Date: Tue, 6 Apr 2010 16:13:00 +0800
Subject: forming one datset from multiple data files
Message-ID: <TUE.6.APR.2010.161300.0800.FIELDTRIP@NIC.SURFNET.NL>

Hi,

Recently I started to use FieldTrip for my EEG analysis. In my experiment,
there were several sessions per condition saved in separate data files. I
would like to put them all into one dataset.

I went through the tutorial but it seemed all the operations assumed we had
one data file per condition. Is there any way to form one dataset from two
or more data files? I know I can do it manually, just wanna know if there is
a function already in the toolbox.

Thanks & best regards,
Dan Zhang

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100406/adb15271/attachment.htm>

From ingrid.nieuwenhuis at FCDONDERS.RU.NL  Tue Apr  6 10:37:45 2010
From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis)
Date: Tue, 6 Apr 2010 10:37:45 +0200
Subject: forming one datset from multiple data files
In-Reply-To: <n2se966c9b21004060113jce1cf8cdw8745aa3c80174b4a@mail.gmail.com>
Message-ID: <TUE.6.APR.2010.103745.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Dan,



I think ft_appenddata is what you need. This is the help of the function:



% FT_APPENDDATA combines multiple datasets that have been preprocessed
separately

% into a single large dataset.

%

% Use as

%   data = ft_appenddata(cfg, data1, data2, data3, ...)

% where the configuration can be empty.

%

% If the input datasets all have the same channels, the trials will be

% concatenated. This is useful for example if you have different

% experimental conditions, which, besides analyzing them separately, for

% some reason you also want to analyze together. The function will check

% for consistency in the order of the channels. If the order is inconsistent

% the channel order of the output will be according to the channel order of

% the first data structure in the input.

%

% If the input datasets have different channels, but the same number of

% trials, the channels will be concatenated within each trial. This is

% useful for example if the data that you want to analyze contains both

% MEG and EMG channels which require different preprocessing options.

%

% Occasionally, the data needs to be concatenated in the trial dimension
while

% there's a slight discrepancy in the channels in the input data (e.g.
missing

% channels in one of the data structures). The function will then return a
data

% structure containing only the channels which are present in all inputs.

% See also FT_PREPROCESSING



Good luck,

Ingrid



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

Ingrid L.C. Nieuwenhuis

PhD student

Donders Institute for Brain, Cognition and Behaviour,

Centre for Cognitive Neuroimaging

Radboud University Nijmegen, The Netherlands

Email: ingrid.nieuwenhuis at donders.ru.nl

Tel: 0031 (0)24 - 36 10887

  _____

From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Dan Zhang
Sent: Tuesday, April 06, 2010 10:13 AM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: [FIELDTRIP] forming one datset from multiple data files



Hi,

Recently I started to use FieldTrip for my EEG analysis. In my experiment,
there were several sessions per condition saved in separate data files. I
would like to put them all into one dataset.

I went through the tutorial but it seemed all the operations assumed we had
one data file per condition. Is there any way to form one dataset from two
or more data files? I know I can do it manually, just wanna know if there is
a function already in the toolbox.

Thanks & best regards,
Dan Zhang


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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100406/85a586f6/attachment.htm>

From michael.wibral at WEB.DE  Tue Apr  6 17:27:17 2010
From: michael.wibral at WEB.DE (Michael Wibral)
Date: Tue, 6 Apr 2010 17:27:17 +0200
Subject: Induced activity
In-Reply-To: <Pine.LNX.4.62.1003301319060.32630@gate.nmr.mgh.harvard.edu>
Message-ID: <TUE.6.APR.2010.172717.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Thomas,

you write  "...as long no non-linear operations have been applied...". Computing power is exactly such a non linear operation. Hence the approach you proposed may fail. Also see the discussion on the list. Moreover the average (ERF) may not reflect actvity that is really present in this form in the trials.

Michael


-----Ursprüngliche Nachricht-----
Von: Thomas Witzel <twitzel at NMR.MGH.HARVARD.EDU>
Gesendet: Mar 30, 2010 7:24:16 PM
An: FIELDTRIP at NIC.SURFNET.NL
Betreff: Re: [FIELDTRIP] Induced activity

>Hello all,
>
>just my two cents late in this discussion, and I hope I'm not repeating 
>what someone else has just said. The way I and my code calculate induced 
>activity was that I would first average all trials to get an ERF, then 
>subtract the ERF from each individual trial, and then calculate the the 
>power. This can be done in complex domain (i.e. after some frequency 
>analysis as well) as long no non-linear operations have been applied.
>I never really had any problems with this approach.
>As for the point made by Bobby about the frequency band being strong 
>troughout the trial (even baseline), this makes sense as there is 
>presumably some variation during the baseline as well. To get the "nice" 
>picture, you need to represent the result relative to the baseline to show 
>change of power/magnitude relative to the baseline with whatever flavour
>normalization you like....
>
>Thomas
>
>  On 
>Tue, 30 Mar 2010, Oakman, Erin wrote:
>
>> Hello Bobby,
>>
>> Thanks for raising a very relevant question about the difference between induced and evoked activity !
>>
>> A good discussion of this can be found here, or attached as text
>> https://listserv.surfnet.nl/scripts/wa.cgi?A3=ind0704&L=FIELDTRIP&E=quoted-printable&P=234745&B=--Apple-Mail-1--1050075873&T=text%2Fhtml;%20charset=WINDOWS-1252&XSS=3
>>
>> There is not a definite way to separate the induced and evoked activity.  The reason is that the sum of the squares is not the same as the square of the sum.
>>
>> In my very limited experience, I have noticed that researchers sometimes use the term "induced" or "event-related spectral perturbation" to refer to the average of the single-trials power, which has been base-line corrected .  At least that is the case in the "induced power" in this paper:   Krishnan, G. P., W.P. Hetrick, C.A. Brenner, A. Shekhar, A.N. Steffen and B.F. O'Donnell 2009. Steady state and induced auditory gamma deficits in schizophrenia. Neuroimage.
>>
>>
>> Erin
>>
>>
>>
>> Hi
>>>     A late follow-up to this topic. I have recentrly been musing over how to
>>> get a "clean" measure of the non-phase locked activity. I have tried
>>> subtracting the ERF out prior to time-frequency computation but this
>>> produces quite a bit of artifact...presumably since the single trial data
>>> will have considerable ;atency "jitter"
>>
>> The ERF collapses two sources of "jitter"; in the latency of the transient activity (if it exists) and the phase of ongoing oscillatory activity.
>>
>>>    The comments from Christian below make sense ( I think) why simply
>>> subtracting the two time-frequency power representaions is not valid. But I
>>> wonder would this subtractive approach be valid if one worked with the
>>> magnitude of the signal rather than power..omitting all the squaring operations?
>>
>> Computing the magnitude is still a non-linear operation (square root of a sum of squares, rectification, whatever ... ). The problem for why this won't work either resides in averaging part: in the evoked case you have a linear average followed by a non-linear operation, and in the induced case you have an average of the non-linearly transformed quantity. The "catch phrase" here is: the sum of the squares is not the same as the square of the sum! (or the sum of the rectified data is not the same as the rectified sum)
>>
>> Hope this helps,
>> Christian
>>
>>
>>>   If this right theoretically, how to achieve this in Fieldtrip?. Would
>>> setting cfg.output = 'fourier then abs'ing the output work. My suspicion is
>>> no since the summing is being done first here. Alternatively, does one need
>>> to hack the code to return the magnitude.
>>>
>>> Thanks for your help on this and sorry for waking old threads :)
>>>
>>>    - Suresh
>>>
>>> On Fri, 23 Feb 2007 01:44:59 +0100, Christian Hesse
>>> <c.hesse at FCDONDERS.RU.NL> wrote:
>>>
>>>> One further comment (please see below):
>>>>
>>>>> Hi Thomas,
>>>>>> Following up on this conversation. It seems that the ?induced
>>>>>> activity? contains both phase-locked and non-phase-locked
>>>>>> activity, whereby the ?evoked? activity contains only phase-locked
>>>>>> activity. Is it then kosher to separate these components by linear
>>>>>> subtraction? For example, if we first compute the ?induced?
>>>>>> activity by averaging power over individual trials, and from that
>>>>>> subtract the ?evoked activity? (calculated based on average
>>>>>> response) to get the induced activity without any phase-locked
>>>>>> activity?
>>>>>
>>>>> It is not correct to subtract because computing the induced and
>>>>> evoked power spectra involves squaring signal amplitudes (a non-
>>>>> linear operation), and hence, taking your terminology to refer to
>>>>> the instantaneous amplitudes of the signal components (this applies
>>>>> to any time-frequency tile)
>>>>>> Induced = Phase + Non-Phase
>>>>>>
>>>>>> And
>>>>>>
>>>>>> Evoked = Phase
>>>>>>
>>>>>> Then
>>>>>>
>>>>>> Non-Phase = Induced ? Evoked
>>>>>>
>>>>>>
>>>>> what you actually get from spectral or time-frequency analysis is
>>>>> the power of your MEASURED signal
>>>>>
>>>>> Induced^2 = (Phase + Non-Phase)^2 = Phase^2 + 2*Phase*Non-Phase +
>>>>> Non-Phase^2
>>>>>
>>>>> Evoked^2 = Phase^2
>>>>>
>>>>> Then
>>>>>
>>>>> Induced^2 - Evoked^2 = 2*Phase*Non-Phase + Non-Phase^2  AND NOT Non-
>>>>> Phase^2
>>>>>
>>>> Note that the other crucial thing to consider here is that you are in
>>>> one case averaging power over trials over trials:
>>>>
>>>> E[ (Induced^2)  ] =  E[ (Phase + Non-Phase)^2 ] = E[ (Phase^2 +
>>>> 2*Phase*Non-Phase + Non-Phase^2) ] = E[ (Phase^2) ] E[ (Non-
>>>> Phase^2) ] + E[ 2*Phase*Non-Phase ]
>>>>
>>>> this is why taking the square root of sqrt(Induced^2) does not give
>>>> (Phase + Non-Phase) but sqrt(E[ (Phase+Non-Phase)^2 ]).
>>>>
>>>> in the evoked case you are taking the power of the average amplitude
>>>>
>>>> Evoked^2 = E[ Phase ]^2  (---> note the ^2 on the outside of the sum)
>>>>
>>>> so in subtracting you are actually assuming that E[Phase]^2 = E
>>>> [(Phase)^2] which is unlikely to be accurate the case in finite samples.
>>>>
>>>> Hope I have not confused others (or myself) here.
>>>> Christian
>>>>
>>>>
>>
>>
>>>
>>> This is indeed the approach that I have followed succesfully a couple of
>>> times (e.g. Bastiaansen et al., JOCN 2006), although the terminology that
>>> you are using is somewhat confusing. I (and I guess most people) would refer
>>> to induced activity as that part of the EEG that is non-phase-locked, so I
>>> would restate your equation to:
>>> induced = EEG - evoked.
>>>
>>> However, there is a drawback to this approach, since it assumes that the ERP
>>> is absolutely stationary over trials. This is not the case in reality (e.g.
>>> subjects' attentional level or other states may change from trial to trial,
>>> giving rise to variability in the single-trial ERPs). This means that by
>>> subtracting the average ERP, one may introduce frequency components in the
>>> residual EEG that were not present before. Klimesch, and Kalcher and
>>> Pfurtscheller, have come up with ways of scaling the average ERP so as to
>>> yield a best fit of the average with each single-trial ERP, but also that
>>> approach may be sub-optimal.
>>> My latest way around the problem is to run a TF analysis on the untreated
>>> EEG (containing both evoked and induced activity), and comparing this to a
>>> TF analysis of the subject-averaged ERPs (the evoked activity alone).
>>> Qualitative differences between the two analyses can now only be attributed
>>> to induced activity.
>>>
>>> Marcel
>>>
>>> Thomas Thesen wrote:
>>>>
>>>> Hi FieldTrippers,
>>>>
>>>>
>>>>
>>>> Following up on this conversation. It seems that the ?induced activity?
>>> contains both phase-locked and non-phase-locked activity, whereby the
>>> ?evoked? activity contains only phase-locked activity. Is it then kosher to
>>> separate these components by linear subtraction? For example, if we first
>>> compute the ?induced? activity by averaging power over individual trials,
>>> and from that subtract the ?evoked activity? (calculated based on average
>>> response) to get the induced activity without any phase-locked activity?
>>>>
>>>>
>>>>
>>>> So if
>>>>
>>>> Induced = Phase + Non-Phase
>>>>
>>>> And
>>>>
>>>> Evoked = Phase
>>>>
>>>> Then
>>>>
>>>> Non-Phase = Induced ? Evoked
>>>>
>>>>
>>>>
>>>> Or does the fact that this is a linear operations on data that have been
>>> constructed through a non-linear process render this somehow invalid? It has
>>> certainly been done before. Your comments would be much appreciated.
>>
>>
>>
>>
>> ________________________________________
>> From: FieldTrip discussion list [FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Bobby Stojanoski [stojanoski at UTSC.UTORONTO.CA]
>> Sent: Thursday, March 25, 2010 1:33 PM
>> To: FIELDTRIP at NIC.SURFNET.NL
>> Subject: [FIELDTRIP] Induced activity
>>
>> Dear Fieldtrippers,
>>
>> I am a relatively new user of fieldtrip and am very impressed!
>>
>> I am interested in comparing differences at certain frequencies ? induced 40-100 Hz ? between 2 experimental conditions.  My understanding was that I can calculate induced activity in the gamma range by calculating the power for each trial (subject average -- freqanalysis) and then averaging across subjects (grand average -- freqdescriptives/freqgrandaverage).
>>
>> To my dismay, when I plotted the results of my grandaverage I found a band of power at 55 - 65 Hz for the entire duration of my epoch. I should add this was not the case when I plotted power across trials for each participant.
>>
>> Earlier discussions mention computing induced+evoked (using freqanalysis and freqgrandaverage) and subtracting that from evoked (using timelockanalysis+freqanalysis) to get extract induced only activity. However, later posts suggest that this is not a valid approach.
>>
>> 1. Where have I made my mistake?
>>
>> 2. If ((induced+evoked)-evoked)) is not valid, what is the correct approach to calculating induced activity at 40 - 100 Hz?
>>
>> Any help would be greatly appreciated!
>>
>> Thank you
>> Bobby Stojanoski
>>
>>
>>
>>
>> ----------------------------------
>>
>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.
>>
>> http://listserv.surfnet.nl/archives/fieldtrip.html
>>
>> http://www.ru.nl/fcdonders/fieldtrip/
>>
>> 
>> 
>> 
>> ------------------------------------------------------------

>> This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.

>> =================================
>> </body>
>> 
>> 
>>
>> ----------------------------------
>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
>>
>
>
>The information in this e-mail is intended only for the person to whom it is
>addressed. If you believe this e-mail was sent to you in error and the e-mail
>contains patient information, please contact the Partners Compliance HelpLine at
>http://www.partners.org/complianceline . If the e-mail was sent to you in error
>but does not contain patient information, please contact the sender and properly
>dispose of the e-mail.
>
>----------------------------------
>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Michael Wibral.vcf
Type: text/x-vcard
Size: 628 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100406/0053b9d8/attachment.vcf>

From lucie.charles.ens at GOOGLEMAIL.COM  Tue Apr  6 17:39:18 2010
From: lucie.charles.ens at GOOGLEMAIL.COM (Lucie Charles)
Date: Tue, 6 Apr 2010 17:39:18 +0200
Subject: trial selection with ft_timelockanalysis
Message-ID: <TUE.6.APR.2010.173918.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Fieldtripers,

I just noticed a small inconsistency in the use of ft_timelockanalysis
function.

If you use the cfg.trials option, be careful to always specify a non-empty
vector.

If the vector that you give to cfg.trials is empty ( ie cfg.trials = [] ),
for example if you have no trials in the specified condition, than
ft_timelockanalysis will take ALL THE TRIALS of the data to compute the
average and no error message will be returned.

The function doesn't detect the contradiction.

Hope this will help some of you.

Cheers,

Lucie

-- 
Lucie CHARLES

INSERM-CEA Cognitive Neuroimaging unit

CEA/SAC/DSV/DRM/NeuroSpin
Bât 145, Point Courrier 156
F-91191 Gif/Yvette, FRANCE
Tel : +33 1 69 08 99 74
Fax : +33 1 69 08 79 73

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100406/ec4de592/attachment.htm>

From twitzel at NMR.MGH.HARVARD.EDU  Tue Apr  6 17:56:53 2010
From: twitzel at NMR.MGH.HARVARD.EDU (Thomas Witzel)
Date: Tue, 6 Apr 2010 11:56:53 -0400
Subject: Induced activity
In-Reply-To: <20268399.2276933.1270567637581.JavaMail.fmail@mwmweb053>
Message-ID: <TUE.6.APR.2010.115653.0400.FIELDTRIP@NIC.SURFNET.NL>


Maybe I wasn't clear. The trick is to maintain the
complex components (real and imag) after the wavelet transform, then to
separate induced and evoked and then to calculate power in the end.
This can be done with entire TFRs that way. I'm not sure whether this is
possible in the regular fieldtrip workflow which might cause confusion with
terminology here.
As for the ERF not reflecting activity that might not be present in this
form in the trials, I guess we have a bit of a philosophical question
here. The entire premise of an ERF is that the brain response is identical
in every trial + some noise. Since EEG/MEG is extremely noisy you can't
tell from single trials whats really going on, so averaging all trials
could be the best estimation of what the signal in every trial looks like.
Now, of course we know that this is not entirely true, because in many
experiments we know of systematic trial to trial variation, in which
case the whole ERF or for that matter most common analysis methods are
inappropriate.
Also, even if there is random trial to trial variation, some of it might
not be noise, as already described by Schimmel back in 1967 in a nice
Science article. This is where the induced signal comes in. For me its
signal that can be detected by its respective increase or decrease in
power, but its not coherent across trials so it cancels mostly in ERFs.
Now subtracting the ERF from every trial brings the assumption back in
that the evoked signal is the same in every trial which it might be or
might not be. In most of the experiments I have analyzed subaverages
(separate even and odd trials, or early and late ones) were very similar,
so the assumption that the evoked response is the same in every trial was
fair.
Practically I found that subtracting the ERF or not, has very little
impact on the final outcome, but I didn't test every case, so I'm
subtracting where its deemed appropriate....

Thomas


  On Tue, 6 Apr
2010, Michael Wibral wrote:

> Dear Thomas,
>
> you write  "...as long no non-linear operations have been applied...". Computing power is exactly such a non linear operation. Hence the approach you proposed may fail. Also see the discussion on the list. Moreover the average (ERF) may not reflect actvity that is really present in this form in the trials.
>
> Michael
>
>
> -----Ursprüngliche Nachricht-----
> Von: Thomas Witzel <twitzel at NMR.MGH.HARVARD.EDU>
> Gesendet: Mar 30, 2010 7:24:16 PM
> An: FIELDTRIP at NIC.SURFNET.NL
> Betreff: Re: [FIELDTRIP] Induced activity
>
>> Hello all,
>>
>> just my two cents late in this discussion, and I hope I'm not repeating
>> what someone else has just said. The way I and my code calculate induced
>> activity was that I would first average all trials to get an ERF, then
>> subtract the ERF from each individual trial, and then calculate the the
>> power. This can be done in complex domain (i.e. after some frequency
>> analysis as well) as long no non-linear operations have been applied.
>> I never really had any problems with this approach.
>> As for the point made by Bobby about the frequency band being strong
>> troughout the trial (even baseline), this makes sense as there is
>> presumably some variation during the baseline as well. To get the "nice"
>> picture, you need to represent the result relative to the baseline to show
>> change of power/magnitude relative to the baseline with whatever flavour
>> normalization you like....
>>
>> Thomas
>>
>>  On
>> Tue, 30 Mar 2010, Oakman, Erin wrote:
>>
>>> Hello Bobby,
>>>
>>> Thanks for raising a very relevant question about the difference between induced and evoked activity !
>>>
>>> A good discussion of this can be found here, or attached as text
>>> https://listserv.surfnet.nl/scripts/wa.cgi?A3=ind0704&L=FIELDTRIP&E=quoted-printable&P=234745&B=--Apple-Mail-1--1050075873&T=text%2Fhtml;%20charset=WINDOWS-1252&XSS=3
>>>
>>> There is not a definite way to separate the induced and evoked activity.  The reason is that the sum of the squares is not the same as the square of the sum.
>>>
>>> In my very limited experience, I have noticed that researchers sometimes use the term "induced" or "event-related spectral perturbation" to refer to the average of the single-trials power, which has been base-line corrected .  At least that is the case in the "induced power" in this paper:   Krishnan, G. P., W.P. Hetrick, C.A. Brenner, A. Shekhar, A.N. Steffen and B.F. O'Donnell 2009. Steady state and induced auditory gamma deficits in schizophrenia. Neuroimage.
>>>
>>>
>>> Erin
>>>
>>>
>>>
>>> Hi
>>>>     A late follow-up to this topic. I have recentrly been musing over how to
>>>> get a "clean" measure of the non-phase locked activity. I have tried
>>>> subtracting the ERF out prior to time-frequency computation but this
>>>> produces quite a bit of artifact...presumably since the single trial data
>>>> will have considerable ;atency "jitter"
>>>
>>> The ERF collapses two sources of "jitter"; in the latency of the transient activity (if it exists) and the phase of ongoing oscillatory activity.
>>>
>>>>    The comments from Christian below make sense ( I think) why simply
>>>> subtracting the two time-frequency power representaions is not valid. But I
>>>> wonder would this subtractive approach be valid if one worked with the
>>>> magnitude of the signal rather than power..omitting all the squaring operations?
>>>
>>> Computing the magnitude is still a non-linear operation (square root of a sum of squares, rectification, whatever ... ). The problem for why this won't work either resides in averaging part: in the evoked case you have a linear average followed by a non-linear operation, and in the induced case you have an average of the non-linearly transformed quantity. The "catch phrase" here is: the sum of the squares is not the same as the square of the sum! (or the sum of the rectified data is not the same as the rectified sum)
>>>
>>> Hope this helps,
>>> Christian
>>>
>>>
>>>>   If this right theoretically, how to achieve this in Fieldtrip?. Would
>>>> setting cfg.output = 'fourier then abs'ing the output work. My suspicion is
>>>> no since the summing is being done first here. Alternatively, does one need
>>>> to hack the code to return the magnitude.
>>>>
>>>> Thanks for your help on this and sorry for waking old threads :)
>>>>
>>>>    - Suresh
>>>>
>>>> On Fri, 23 Feb 2007 01:44:59 +0100, Christian Hesse
>>>> <c.hesse at FCDONDERS.RU.NL> wrote:
>>>>
>>>>> One further comment (please see below):
>>>>>
>>>>>> Hi Thomas,
>>>>>>> Following up on this conversation. It seems that the ?induced
>>>>>>> activity? contains both phase-locked and non-phase-locked
>>>>>>> activity, whereby the ?evoked? activity contains only phase-locked
>>>>>>> activity. Is it then kosher to separate these components by linear
>>>>>>> subtraction? For example, if we first compute the ?induced?
>>>>>>> activity by averaging power over individual trials, and from that
>>>>>>> subtract the ?evoked activity? (calculated based on average
>>>>>>> response) to get the induced activity without any phase-locked
>>>>>>> activity?
>>>>>>
>>>>>> It is not correct to subtract because computing the induced and
>>>>>> evoked power spectra involves squaring signal amplitudes (a non-
>>>>>> linear operation), and hence, taking your terminology to refer to
>>>>>> the instantaneous amplitudes of the signal components (this applies
>>>>>> to any time-frequency tile)
>>>>>>> Induced = Phase + Non-Phase
>>>>>>>
>>>>>>> And
>>>>>>>
>>>>>>> Evoked = Phase
>>>>>>>
>>>>>>> Then
>>>>>>>
>>>>>>> Non-Phase = Induced ? Evoked
>>>>>>>
>>>>>>>
>>>>>> what you actually get from spectral or time-frequency analysis is
>>>>>> the power of your MEASURED signal
>>>>>>
>>>>>> Induced^2 = (Phase + Non-Phase)^2 = Phase^2 + 2*Phase*Non-Phase +
>>>>>> Non-Phase^2
>>>>>>
>>>>>> Evoked^2 = Phase^2
>>>>>>
>>>>>> Then
>>>>>>
>>>>>> Induced^2 - Evoked^2 = 2*Phase*Non-Phase + Non-Phase^2  AND NOT Non-
>>>>>> Phase^2
>>>>>>
>>>>> Note that the other crucial thing to consider here is that you are in
>>>>> one case averaging power over trials over trials:
>>>>>
>>>>> E[ (Induced^2)  ] =  E[ (Phase + Non-Phase)^2 ] = E[ (Phase^2 +
>>>>> 2*Phase*Non-Phase + Non-Phase^2) ] = E[ (Phase^2) ] E[ (Non-
>>>>> Phase^2) ] + E[ 2*Phase*Non-Phase ]
>>>>>
>>>>> this is why taking the square root of sqrt(Induced^2) does not give
>>>>> (Phase + Non-Phase) but sqrt(E[ (Phase+Non-Phase)^2 ]).
>>>>>
>>>>> in the evoked case you are taking the power of the average amplitude
>>>>>
>>>>> Evoked^2 = E[ Phase ]^2  (---> note the ^2 on the outside of the sum)
>>>>>
>>>>> so in subtracting you are actually assuming that E[Phase]^2 = E
>>>>> [(Phase)^2] which is unlikely to be accurate the case in finite samples.
>>>>>
>>>>> Hope I have not confused others (or myself) here.
>>>>> Christian
>>>>>
>>>>>
>>>
>>>
>>>>
>>>> This is indeed the approach that I have followed succesfully a couple of
>>>> times (e.g. Bastiaansen et al., JOCN 2006), although the terminology that
>>>> you are using is somewhat confusing. I (and I guess most people) would refer
>>>> to induced activity as that part of the EEG that is non-phase-locked, so I
>>>> would restate your equation to:
>>>> induced = EEG - evoked.
>>>>
>>>> However, there is a drawback to this approach, since it assumes that the ERP
>>>> is absolutely stationary over trials. This is not the case in reality (e.g.
>>>> subjects' attentional level or other states may change from trial to trial,
>>>> giving rise to variability in the single-trial ERPs). This means that by
>>>> subtracting the average ERP, one may introduce frequency components in the
>>>> residual EEG that were not present before. Klimesch, and Kalcher and
>>>> Pfurtscheller, have come up with ways of scaling the average ERP so as to
>>>> yield a best fit of the average with each single-trial ERP, but also that
>>>> approach may be sub-optimal.
>>>> My latest way around the problem is to run a TF analysis on the untreated
>>>> EEG (containing both evoked and induced activity), and comparing this to a
>>>> TF analysis of the subject-averaged ERPs (the evoked activity alone).
>>>> Qualitative differences between the two analyses can now only be attributed
>>>> to induced activity.
>>>>
>>>> Marcel
>>>>
>>>> Thomas Thesen wrote:
>>>>>
>>>>> Hi FieldTrippers,
>>>>>
>>>>>
>>>>>
>>>>> Following up on this conversation. It seems that the ?induced activity?
>>>> contains both phase-locked and non-phase-locked activity, whereby the
>>>> ?evoked? activity contains only phase-locked activity. Is it then kosher to
>>>> separate these components by linear subtraction? For example, if we first
>>>> compute the ?induced? activity by averaging power over individual trials,
>>>> and from that subtract the ?evoked activity? (calculated based on average
>>>> response) to get the induced activity without any phase-locked activity?
>>>>>
>>>>>
>>>>>
>>>>> So if
>>>>>
>>>>> Induced = Phase + Non-Phase
>>>>>
>>>>> And
>>>>>
>>>>> Evoked = Phase
>>>>>
>>>>> Then
>>>>>
>>>>> Non-Phase = Induced ? Evoked
>>>>>
>>>>>
>>>>>
>>>>> Or does the fact that this is a linear operations on data that have been
>>>> constructed through a non-linear process render this somehow invalid? It has
>>>> certainly been done before. Your comments would be much appreciated.
>>>
>>>
>>>
>>>
>>> ________________________________________
>>> From: FieldTrip discussion list [FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Bobby Stojanoski [stojanoski at UTSC.UTORONTO.CA]
>>> Sent: Thursday, March 25, 2010 1:33 PM
>>> To: FIELDTRIP at NIC.SURFNET.NL
>>> Subject: [FIELDTRIP] Induced activity
>>>
>>> Dear Fieldtrippers,
>>>
>>> I am a relatively new user of fieldtrip and am very impressed!
>>>
>>> I am interested in comparing differences at certain frequencies ? induced 40-100 Hz ? between 2 experimental conditions.  My understanding was that I can calculate induced activity in the gamma range by calculating the power for each trial (subject average -- freqanalysis) and then averaging across subjects (grand average -- freqdescriptives/freqgrandaverage).
>>>
>>> To my dismay, when I plotted the results of my grandaverage I found a band of power at 55 - 65 Hz for the entire duration of my epoch. I should add this was not the case when I plotted power across trials for each participant.
>>>
>>> Earlier discussions mention computing induced+evoked (using freqanalysis and freqgrandaverage) and subtracting that from evoked (using timelockanalysis+freqanalysis) to get extract induced only activity. However, later posts suggest that this is not a valid approach.
>>>
>>> 1. Where have I made my mistake?
>>>
>>> 2. If ((induced+evoked)-evoked)) is not valid, what is the correct approach to calculating induced activity at 40 - 100 Hz?
>>>
>>> Any help would be greatly appreciated!
>>>
>>> Thank you
>>> Bobby Stojanoski
>>>
>>>
>>>
>>>
>>> ----------------------------------
>>>
>>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.
>>>
>>> http://listserv.surfnet.nl/archives/fieldtrip.html
>>>
>>> http://www.ru.nl/fcdonders/fieldtrip/
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------
>
>>> This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
>
>>> =================================
>>> </body>
>>>
>>>
>>>
>>> ----------------------------------
>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
>>>
>>
>>
>> The information in this e-mail is intended only for the person to whom it is
>> addressed. If you believe this e-mail was sent to you in error and the e-mail
>> contains patient information, please contact the Partners Compliance HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you in error
>> but does not contain patient information, please contact the sender and properly
>> dispose of the e-mail.
>>
>> ----------------------------------
>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

From michael.wibral at WEB.DE  Wed Apr  7 09:49:01 2010
From: michael.wibral at WEB.DE (Michael Wibral)
Date: Wed, 7 Apr 2010 09:49:01 +0200
Subject: Induced activity
In-Reply-To: <Pine.LNX.4.62.1004061141440.15262@gate.nmr.mgh.harvard.edu>
Message-ID: <WED.7.APR.2010.094901.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Thomas,


"...
Maybe I wasn't clear. The trick is to maintain the 
complex components (real and imag) after the wavelet transform, then to 
separate induced and evoked and then to calculate power in the end.
..."

>>From what I understand you suggest to:

(a) take the FFT of a trial :

FFT(trial i)

(b) then to take the average of those FFTs and stay in the complex domain:

1/n [sum(FFT(trial i))]

(c) to subtract this complex quantity from each trial:

FFT(trial i) - 1/n [sum(FFT(trial i))]

(d) and to take the power and then the average , finally:

1/n sum {(FFT(trial i) - 1/n [sum(FFT(trial i))])^2}


If you transform this, taking the linearity of the FFT into account where appropriate you get:

1/n sum {(FFT(trial i) - 1/n [sum(FFT(trial i))])^2} =

1/n sum {(FFT(trial i - 1/n [sum(trial i)])^2}=

1/n sum {(FFT(trial i - ERF))^2 }

In the end you seem to subtract the ERF from each trial, then take the FFT compute power and then compute the average. I am  a bit confused here: To me this seems to be the same approach as simply subtracting the ERF in the time domain before computing power, i.e. a simple version of the old regression approach. In my opinion this must be the case. This is because keeping the numbers complex, means keeping phase information and computing the average over trials in the Fourier domain should then be the same as computing the (trivially phase-sensitive) average in the time domain, then taking the Fourier transform.

On the other hand, if you really take power as the very last operation:

{1/n sum (FFT(trial i) - 1/n [sum(FFT(trial i))])}^2 =

{1/n sum (FFT(trial i - ERF)) }^2 =

{1/n sum (FFT(trial i)) - FFT(ERF)) }^2 =

{1/n sum (FFT(trial i)) - 1/n n FFT(ERF) }^2 =

{FFT(1/n sum (trial i)) - FFT(ERF)}^2 =

{FFT(ERF) - FFT(ERF)}^2 = 0   


Could you let me know where I misunderstand that approach?

With regards to something like the ERF being present in every single trial, I was thinking of other mechanisms like phase-reset or asymetric modulations of oscillation amplitude that may or may not be detected by looking at power increases.

Michael



-----Ursprüngliche Nachricht-----
Von: Thomas Witzel <twitzel at NMR.MGH.HARVARD.EDU>
Gesendet: Apr 6, 2010 5:56:53 PM
An: FIELDTRIP at NIC.SURFNET.NL
Betreff: Re: [FIELDTRIP] Induced activity

>
>Maybe I wasn't clear. The trick is to maintain the 
>complex components (real and imag) after the wavelet transform, then to 
>separate induced and evoked and then to calculate power in the end.
>This can be done with entire TFRs that way. I'm not sure whether this is 
>possible in the regular fieldtrip workflow which might cause confusion with
>terminology here.
>As for the ERF not reflecting activity that might not be present in this 
>form in the trials, I guess we have a bit of a philosophical question 
>here. The entire premise of an ERF is that the brain response is identical 
>in every trial + some noise. Since EEG/MEG is extremely noisy you can't 
>tell from single trials whats really going on, so averaging all trials 
>could be the best estimation of what the signal in every trial looks like.
>Now, of course we know that this is not entirely true, because in many 
>experiments we know of systematic trial to trial variation, in which
>case the whole ERF or for that matter most common analysis methods are 
>inappropriate.
>Also, even if there is random trial to trial variation, some of it might 
>not be noise, as already described by Schimmel back in 1967 in a nice 
>Science article. This is where the induced signal comes in. For me its 
>signal that can be detected by its respective increase or decrease in 
>power, but its not coherent across trials so it cancels mostly in ERFs.
>Now subtracting the ERF from every trial brings the assumption back in 
>that the evoked signal is the same in every trial which it might be or 
>might not be. In most of the experiments I have analyzed subaverages 
>(separate even and odd trials, or early and late ones) were very similar,
>so the assumption that the evoked response is the same in every trial was 
>fair.
>Practically I found that subtracting the ERF or not, has very little
>impact on the final outcome, but I didn't test every case, so I'm 
>subtracting where its deemed appropriate....
>
>Thomas
>
>
>  On Tue, 6 Apr 
>2010, Michael Wibral wrote:
>
>> Dear Thomas,
>>
>> you write  "...as long no non-linear operations have been applied...". Computing power is exactly such a non linear operation. Hence the approach you proposed may fail. Also see the discussion on the list. Moreover the average (ERF) may not reflect actvity that is really present in this form in the trials.
>>
>> Michael
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Thomas Witzel <twitzel at NMR.MGH.HARVARD.EDU>
>> Gesendet: Mar 30, 2010 7:24:16 PM
>> An: FIELDTRIP at NIC.SURFNET.NL
>> Betreff: Re: [FIELDTRIP] Induced activity
>>
>>> Hello all,
>>>
>>> just my two cents late in this discussion, and I hope I'm not repeating
>>> what someone else has just said. The way I and my code calculate induced
>>> activity was that I would first average all trials to get an ERF, then
>>> subtract the ERF from each individual trial, and then calculate the the
>>> power. This can be done in complex domain (i.e. after some frequency
>>> analysis as well) as long no non-linear operations have been applied.
>>> I never really had any problems with this approach.
>>> As for the point made by Bobby about the frequency band being strong
>>> troughout the trial (even baseline), this makes sense as there is
>>> presumably some variation during the baseline as well. To get the "nice"
>>> picture, you need to represent the result relative to the baseline to show
>>> change of power/magnitude relative to the baseline with whatever flavour
>>> normalization you like....
>>>
>>> Thomas
>>>
>>>  On
>>> Tue, 30 Mar 2010, Oakman, Erin wrote:
>>>
>>>> Hello Bobby,
>>>>
>>>> Thanks for raising a very relevant question about the difference between induced and evoked activity !
>>>>
>>>> A good discussion of this can be found here, or attached as text
>>>> https://listserv.surfnet.nl/scripts/wa.cgi?A3=ind0704&L=FIELDTRIP&E=quoted-printable&P=234745&B=--Apple-Mail-1--1050075873&T=text%2Fhtml;%20charset=WINDOWS-1252&XSS=3
>>>>
>>>> There is not a definite way to separate the induced and evoked activity.  The reason is that the sum of the squares is not the same as the square of the sum.
>>>>
>>>> In my very limited experience, I have noticed that researchers sometimes use the term "induced" or "event-related spectral perturbation" to refer to the average of the single-trials power, which has been base-line corrected .  At least that is the case in the "induced power" in this paper:   Krishnan, G. P., W.P. Hetrick, C.A. Brenner, A. Shekhar, A.N. Steffen and B.F. O'Donnell 2009. Steady state and induced auditory gamma deficits in schizophrenia. Neuroimage.
>>>>
>>>>
>>>> Erin
>>>>
>>>>
>>>>
>>>> Hi
>>>>>     A late follow-up to this topic. I have recentrly been musing over how to
>>>>> get a "clean" measure of the non-phase locked activity. I have tried
>>>>> subtracting the ERF out prior to time-frequency computation but this
>>>>> produces quite a bit of artifact...presumably since the single trial data
>>>>> will have considerable ;atency "jitter"
>>>>
>>>> The ERF collapses two sources of "jitter"; in the latency of the transient activity (if it exists) and the phase of ongoing oscillatory activity.
>>>>
>>>>>    The comments from Christian below make sense ( I think) why simply
>>>>> subtracting the two time-frequency power representaions is not valid. But I
>>>>> wonder would this subtractive approach be valid if one worked with the
>>>>> magnitude of the signal rather than power..omitting all the squaring operations?
>>>>
>>>> Computing the magnitude is still a non-linear operation (square root of a sum of squares, rectification, whatever ... ). The problem for why this won't work either resides in averaging part: in the evoked case you have a linear average followed by a non-linear operation, and in the induced case you have an average of the non-linearly transformed quantity. The "catch phrase" here is: the sum of the squares is not the same as the square of the sum! (or the sum of the rectified data is not the same as the rectified sum)
>>>>
>>>> Hope this helps,
>>>> Christian
>>>>
>>>>
>>>>>   If this right theoretically, how to achieve this in Fieldtrip?. Would
>>>>> setting cfg.output = 'fourier then abs'ing the output work. My suspicion is
>>>>> no since the summing is being done first here. Alternatively, does one need
>>>>> to hack the code to return the magnitude.
>>>>>
>>>>> Thanks for your help on this and sorry for waking old threads :)
>>>>>
>>>>>    - Suresh
>>>>>
>>>>> On Fri, 23 Feb 2007 01:44:59 +0100, Christian Hesse
>>>>> <c.hesse at FCDONDERS.RU.NL> wrote:
>>>>>
>>>>>> One further comment (please see below):
>>>>>>
>>>>>>> Hi Thomas,
>>>>>>>> Following up on this conversation. It seems that the ?induced
>>>>>>>> activity? contains both phase-locked and non-phase-locked
>>>>>>>> activity, whereby the ?evoked? activity contains only phase-locked
>>>>>>>> activity. Is it then kosher to separate these components by linear
>>>>>>>> subtraction? For example, if we first compute the ?induced?
>>>>>>>> activity by averaging power over individual trials, and from that
>>>>>>>> subtract the ?evoked activity? (calculated based on average
>>>>>>>> response) to get the induced activity without any phase-locked
>>>>>>>> activity?
>>>>>>>
>>>>>>> It is not correct to subtract because computing the induced and
>>>>>>> evoked power spectra involves squaring signal amplitudes (a non-
>>>>>>> linear operation), and hence, taking your terminology to refer to
>>>>>>> the instantaneous amplitudes of the signal components (this applies
>>>>>>> to any time-frequency tile)
>>>>>>>> Induced = Phase + Non-Phase
>>>>>>>>
>>>>>>>> And
>>>>>>>>
>>>>>>>> Evoked = Phase
>>>>>>>>
>>>>>>>> Then
>>>>>>>>
>>>>>>>> Non-Phase = Induced ? Evoked
>>>>>>>>
>>>>>>>>
>>>>>>> what you actually get from spectral or time-frequency analysis is
>>>>>>> the power of your MEASURED signal
>>>>>>>
>>>>>>> Induced^2 = (Phase + Non-Phase)^2 = Phase^2 + 2*Phase*Non-Phase +
>>>>>>> Non-Phase^2
>>>>>>>
>>>>>>> Evoked^2 = Phase^2
>>>>>>>
>>>>>>> Then
>>>>>>>
>>>>>>> Induced^2 - Evoked^2 = 2*Phase*Non-Phase + Non-Phase^2  AND NOT Non-
>>>>>>> Phase^2
>>>>>>>
>>>>>> Note that the other crucial thing to consider here is that you are in
>>>>>> one case averaging power over trials over trials:
>>>>>>
>>>>>> E[ (Induced^2)  ] =  E[ (Phase + Non-Phase)^2 ] = E[ (Phase^2 +
>>>>>> 2*Phase*Non-Phase + Non-Phase^2) ] = E[ (Phase^2) ] E[ (Non-
>>>>>> Phase^2) ] + E[ 2*Phase*Non-Phase ]
>>>>>>
>>>>>> this is why taking the square root of sqrt(Induced^2) does not give
>>>>>> (Phase + Non-Phase) but sqrt(E[ (Phase+Non-Phase)^2 ]).
>>>>>>
>>>>>> in the evoked case you are taking the power of the average amplitude
>>>>>>
>>>>>> Evoked^2 = E[ Phase ]^2  (---> note the ^2 on the outside of the sum)
>>>>>>
>>>>>> so in subtracting you are actually assuming that E[Phase]^2 = E
>>>>>> [(Phase)^2] which is unlikely to be accurate the case in finite samples.
>>>>>>
>>>>>> Hope I have not confused others (or myself) here.
>>>>>> Christian
>>>>>>
>>>>>>
>>>>
>>>>
>>>>>
>>>>> This is indeed the approach that I have followed succesfully a couple of
>>>>> times (e.g. Bastiaansen et al., JOCN 2006), although the terminology that
>>>>> you are using is somewhat confusing. I (and I guess most people) would refer
>>>>> to induced activity as that part of the EEG that is non-phase-locked, so I
>>>>> would restate your equation to:
>>>>> induced = EEG - evoked.
>>>>>
>>>>> However, there is a drawback to this approach, since it assumes that the ERP
>>>>> is absolutely stationary over trials. This is not the case in reality (e.g.
>>>>> subjects' attentional level or other states may change from trial to trial,
>>>>> giving rise to variability in the single-trial ERPs). This means that by
>>>>> subtracting the average ERP, one may introduce frequency components in the
>>>>> residual EEG that were not present before. Klimesch, and Kalcher and
>>>>> Pfurtscheller, have come up with ways of scaling the average ERP so as to
>>>>> yield a best fit of the average with each single-trial ERP, but also that
>>>>> approach may be sub-optimal.
>>>>> My latest way around the problem is to run a TF analysis on the untreated
>>>>> EEG (containing both evoked and induced activity), and comparing this to a
>>>>> TF analysis of the subject-averaged ERPs (the evoked activity alone).
>>>>> Qualitative differences between the two analyses can now only be attributed
>>>>> to induced activity.
>>>>>
>>>>> Marcel
>>>>>
>>>>> Thomas Thesen wrote:
>>>>>>
>>>>>> Hi FieldTrippers,
>>>>>>
>>>>>>
>>>>>>
>>>>>> Following up on this conversation. It seems that the ?induced activity?
>>>>> contains both phase-locked and non-phase-locked activity, whereby the
>>>>> ?evoked? activity contains only phase-locked activity. Is it then kosher to
>>>>> separate these components by linear subtraction? For example, if we first
>>>>> compute the ?induced? activity by averaging power over individual trials,
>>>>> and from that subtract the ?evoked activity? (calculated based on average
>>>>> response) to get the induced activity without any phase-locked activity?
>>>>>>
>>>>>>
>>>>>>
>>>>>> So if
>>>>>>
>>>>>> Induced = Phase + Non-Phase
>>>>>>
>>>>>> And
>>>>>>
>>>>>> Evoked = Phase
>>>>>>
>>>>>> Then
>>>>>>
>>>>>> Non-Phase = Induced ? Evoked
>>>>>>
>>>>>>
>>>>>>
>>>>>> Or does the fact that this is a linear operations on data that have been
>>>>> constructed through a non-linear process render this somehow invalid? It has
>>>>> certainly been done before. Your comments would be much appreciated.
>>>>
>>>>
>>>>
>>>>
>>>> ________________________________________
>>>> From: FieldTrip discussion list [FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Bobby Stojanoski [stojanoski at UTSC.UTORONTO.CA]
>>>> Sent: Thursday, March 25, 2010 1:33 PM
>>>> To: FIELDTRIP at NIC.SURFNET.NL
>>>> Subject: [FIELDTRIP] Induced activity
>>>>
>>>> Dear Fieldtrippers,
>>>>
>>>> I am a relatively new user of fieldtrip and am very impressed!
>>>>
>>>> I am interested in comparing differences at certain frequencies ? induced 40-100 Hz ? between 2 experimental conditions.  My understanding was that I can calculate induced activity in the gamma range by calculating the power for each trial (subject average -- freqanalysis) and then averaging across subjects (grand average -- freqdescriptives/freqgrandaverage).
>>>>
>>>> To my dismay, when I plotted the results of my grandaverage I found a band of power at 55 - 65 Hz for the entire duration of my epoch. I should add this was not the case when I plotted power across trials for each participant.
>>>>
>>>> Earlier discussions mention computing induced+evoked (using freqanalysis and freqgrandaverage) and subtracting that from evoked (using timelockanalysis+freqanalysis) to get extract induced only activity. However, later posts suggest that this is not a valid approach.
>>>>
>>>> 1. Where have I made my mistake?
>>>>
>>>> 2. If ((induced+evoked)-evoked)) is not valid, what is the correct approach to calculating induced activity at 40 - 100 Hz?
>>>>
>>>> Any help would be greatly appreciated!
>>>>
>>>> Thank you
>>>> Bobby Stojanoski
>>>>
>>>>
>>>>
>>>>
>>>> ----------------------------------
>>>>
>>>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.
>>>>
>>>> http://listserv.surfnet.nl/archives/fieldtrip.html
>>>>
>>>> http://www.ru.nl/fcdonders/fieldtrip/
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------
>>
>>>> This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email.
>>
>>>> =================================
>>>> </body>
>>>>
>>>>
>>>>
>>>> ----------------------------------
>>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
>>>>
>>>
>>>
>>> The information in this e-mail is intended only for the person to whom it is
>>> addressed. If you believe this e-mail was sent to you in error and the e-mail
>>> contains patient information, please contact the Partners Compliance HelpLine at
>>> http://www.partners.org/complianceline . If the e-mail was sent to you in error
>>> but does not contain patient information, please contact the sender and properly
>>> dispose of the e-mail.
>>>
>>> ----------------------------------
>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
>>
>> ----------------------------------
>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
>
>----------------------------------
>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Michael Wibral.vcf
Type: text/x-vcard
Size: 628 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100407/26ec5b42/attachment.vcf>

From sklein at BERKELEY.EDU  Wed Apr  7 10:55:41 2010
From: sklein at BERKELEY.EDU (Stanley Klein)
Date: Wed, 7 Apr 2010 01:55:41 -0700
Subject: Induced activity
In-Reply-To: <2205918.2494571.1270626541190.JavaMail.fmail@mwmweb053>
Message-ID: <WED.7.APR.2010.015541.0700.>

This is a most interesting and important thread.  I would think that one
would want to separate the time-locked from the non-time-locked components
independent of whether they were generated by a true additive response,
or by phase resetting or by asymmetric modulation of noise. The reason is
that the ERP/ERF is so simple to show in a standard one-dimensional plot
that one would want to separate it out. Then one would want to display the
rest of the response in some sorts of power and coherence plots. The obvious
thing to do is to subtract off the ERP from each event on a trial by trail
basis as Thomas suggested 7 days ago, and then calculate power and
coherence. I don't see what's wrong with that as a first approximation.

The thing I'd do as a 2nd approximation is to take into account the changing
gain from trial to trial whereby the amplitude (but not phase, for
simplicity) of the evoked response can change from trial to trial.  Suppose:

V(t, k) is the raw data on the kth trial
Ve(t), the evoked response, is the mean of V(t,k) , averaged over all k
trials.
Pe = Ve(t) Ve(t)  is the power of the evoked response. We are using the
     Einstein summation convention of summing over repeated indices (t in
this case) .
f (k)=V(t,k) Ve(t) / Pe is the amplitude of the evoked response on the kth
trial.
The induced response can now be obtained:
Vi(t, k) = V(t, k) - f(k) Ve(t)

By the definition of f(k) the dot product of Vi and Ve is zero for each k.
If one doesn't do this doesn't one get all sort of things that look like
coherence but that are simply the dumb, standard ERP/ERF. I hope I'm not
saying something stupid by forgetting something simple.
Stan
On Wed, Apr 7, 2010 at 12:49 AM, Michael Wibral <michael.wibral at web.de>wrote:

> Hi Thomas,
>
>
> "...
> Maybe I wasn't clear. The trick is to maintain the
> complex components (real and imag) after the wavelet transform, then to
> separate induced and evoked and then to calculate power in the end.
> ..."
>
> From what I understand you suggest to:
>
> (a) take the FFT of a trial :
>
> FFT(trial i)
>
> (b) then to take the average of those FFTs and stay in the complex domain:
>
> 1/n [sum(FFT(trial i))]
>
> (c) to subtract this complex quantity from each trial:
>
> FFT(trial i) - 1/n [sum(FFT(trial i))]
>
> (d) and to take the power and then the average , finally:
>
> 1/n sum {(FFT(trial i) - 1/n [sum(FFT(trial i))])^2}
>
>
> If you transform this, taking the linearity of the FFT into account where
> appropriate you get:
>
> 1/n sum {(FFT(trial i) - 1/n [sum(FFT(trial i))])^2} =
>
> 1/n sum {(FFT(trial i - 1/n [sum(trial i)])^2}=
>
> 1/n sum {(FFT(trial i - ERF))^2 }
>
> In the end you seem to subtract the ERF from each trial, then take the FFT
> compute power and then compute the average. I am  a bit confused here: To me
> this seems to be the same approach as simply subtracting the ERF in the time
> domain before computing power, i.e. a simple version of the old regression
> approach. In my opinion this must be the case. This is because keeping the
> numbers complex, means keeping phase information and computing the average
> over trials in the Fourier domain should then be the same as computing the
> (trivially phase-sensitive) average in the time domain, then taking the
> Fourier transform.
>
> On the other hand, if you really take power as the very last operation:
>
> {1/n sum (FFT(trial i) - 1/n [sum(FFT(trial i))])}^2 =
>
> {1/n sum (FFT(trial i - ERF)) }^2 =
>
> {1/n sum (FFT(trial i)) - FFT(ERF)) }^2 =
>
> {1/n sum (FFT(trial i)) - 1/n n FFT(ERF) }^2 =
>
> {FFT(1/n sum (trial i)) - FFT(ERF)}^2 =
>
> {FFT(ERF) - FFT(ERF)}^2 = 0
>
>
> Could you let me know where I misunderstand that approach?
>
> With regards to something like the ERF being present in every single trial,
> I was thinking of other mechanisms like phase-reset or asymetric modulations
> of oscillation amplitude that may or may not be detected by looking at power
> increases.
>
> Michael
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Thomas Witzel <twitzel at NMR.MGH.HARVARD.EDU>
> Gesendet: Apr 6, 2010 5:56:53 PM
>  An: FIELDTRIP at NIC.SURFNET.NL
> Betreff: Re: [FIELDTRIP] Induced activity
>
> >
> >Maybe I wasn't clear. The trick is to maintain the
> >complex components (real and imag) after the wavelet transform, then to
> >separate induced and evoked and then to calculate power in the end.
> >This can be done with entire TFRs that way. I'm not sure whether this is
> >possible in the regular fieldtrip workflow which might cause confusion
> with
> >terminology here.
> >As for the ERF not reflecting activity that might not be present in this
> >form in the trials, I guess we have a bit of a philosophical question
> >here. The entire premise of an ERF is that the brain response is identical
> >in every trial + some noise. Since EEG/MEG is extremely noisy you can't
> >tell from single trials whats really going on, so averaging all trials
> >could be the best estimation of what the signal in every trial looks like.
> >Now, of course we know that this is not entirely true, because in many
> >experiments we know of systematic trial to trial variation, in which
> >case the whole ERF or for that matter most common analysis methods are
> >inappropriate.
> >Also, even if there is random trial to trial variation, some of it might
> >not be noise, as already described by Schimmel back in 1967 in a nice
> >Science article. This is where the induced signal comes in. For me its
> >signal that can be detected by its respective increase or decrease in
> >power, but its not coherent across trials so it cancels mostly in ERFs.
> >Now subtracting the ERF from every trial brings the assumption back in
> >that the evoked signal is the same in every trial which it might be or
> >might not be. In most of the experiments I have analyzed subaverages
> >(separate even and odd trials, or early and late ones) were very similar,
> >so the assumption that the evoked response is the same in every trial was
> >fair.
> >Practically I found that subtracting the ERF or not, has very little
> >impact on the final outcome, but I didn't test every case, so I'm
> >subtracting where its deemed appropriate....
> >
> >Thomas
> >
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100407/ae4355ff/attachment.htm>

From sklein at BERKELEY.EDU  Wed Apr  7 11:34:11 2010
From: sklein at BERKELEY.EDU (Stanley Klein)
Date: Wed, 7 Apr 2010 02:34:11 -0700
Subject: Induced activity (don't forget microsaccades)
Message-ID: <WED.7.APR.2010.023411.0700.>

I forgot to mention that in addition to subtracting off the ERP/ERF one
should also subtract off the mean response to microsaccades (that can depend
on saccade size). When one makes a microsaccade and ones eyes are open, the
visual field jumps and there is an evoked visual response that should be
subtracted out. It is not simply from the ocular dipole.  Sad to say it has
been shown that the pattern of microsaccades are task dependent so they can
be confused with some subset of interesting alpha, beta, gamma, delta,
epsilon responses. It is not adequate to use EOG electrodes near the eye to
detect the microsaccades since that signal is too noisy for the teensy
microsaccades.  I presume ICA is also way too crude a measure since it is
probably messed up with the ocular component of the saccade that is
direction dependent, but I'm not an ICA expert.
Stan

On Wed, Apr 7, 2010 at 1:55 AM, Stanley Klein <sklein at berkeley.edu> wrote:

> This is a most interesting and important thread.  I would think that one
> would want to separate the time-locked from the non-time-locked components
> independent of whether they were generated by a true additive response,
> or by phase resetting or by asymmetric modulation of noise. The reason is
> that the ERP/ERF is so simple to show in a standard one-dimensional plot
> that one would want to separate it out. Then one would want to display the
> rest of the response in some sorts of power and coherence plots. The obvious
> thing to do is to subtract off the ERP from each event on a trial by trail
> basis as Thomas suggested 7 days ago, and then calculate power and
> coherence. I don't see what's wrong with that as a first approximation.
>
> The thing I'd do as a 2nd approximation is to take into account the
> changing gain from trial to trial whereby the amplitude (but not phase, for
> simplicity) of the evoked response can change from trial to trial.  Suppose:
>
> V(t, k) is the raw data on the kth trial
> Ve(t), the evoked response, is the mean of V(t,k) , averaged over all k
> trials.
> Pe = Ve(t) Ve(t)  is the power of the evoked response. We are using the
>      Einstein summation convention of summing over repeated indices (t in
> this case) .
> f (k)=V(t,k) Ve(t) / Pe is the amplitude of the evoked response on the kth
> trial.
> The induced response can now be obtained:
> Vi(t, k) = V(t, k) - f(k) Ve(t)
>
> By the definition of f(k) the dot product of Vi and Ve is zero for each k.
> If one doesn't do this doesn't one get all sort of things that look like
> coherence but that are simply the dumb, standard ERP/ERF. I hope I'm not
> saying something stupid by forgetting something simple.
> Stan
>   On Wed, Apr 7, 2010 at 12:49 AM, Michael Wibral <michael.wibral at web.de>wrote:
>
>> Hi Thomas,
>>
>>
>> "...
>> Maybe I wasn't clear. The trick is to maintain the
>> complex components (real and imag) after the wavelet transform, then to
>> separate induced and evoked and then to calculate power in the end.
>> ..."
>>
>> From what I understand you suggest to:
>>
>> (a) take the FFT of a trial :
>>
>> FFT(trial i)
>>
>> (b) then to take the average of those FFTs and stay in the complex domain:
>>
>> 1/n [sum(FFT(trial i))]
>>
>> (c) to subtract this complex quantity from each trial:
>>
>> FFT(trial i) - 1/n [sum(FFT(trial i))]
>>
>> (d) and to take the power and then the average , finally:
>>
>> 1/n sum {(FFT(trial i) - 1/n [sum(FFT(trial i))])^2}
>>
>>
>> If you transform this, taking the linearity of the FFT into account where
>> appropriate you get:
>>
>> 1/n sum {(FFT(trial i) - 1/n [sum(FFT(trial i))])^2} =
>>
>> 1/n sum {(FFT(trial i - 1/n [sum(trial i)])^2}=
>>
>> 1/n sum {(FFT(trial i - ERF))^2 }
>>
>> In the end you seem to subtract the ERF from each trial, then take the FFT
>> compute power and then compute the average. I am  a bit confused here: To me
>> this seems to be the same approach as simply subtracting the ERF in the time
>> domain before computing power, i.e. a simple version of the old regression
>> approach. In my opinion this must be the case. This is because keeping the
>> numbers complex, means keeping phase information and computing the average
>> over trials in the Fourier domain should then be the same as computing the
>> (trivially phase-sensitive) average in the time domain, then taking the
>> Fourier transform.
>>
>> On the other hand, if you really take power as the very last operation:
>>
>> {1/n sum (FFT(trial i) - 1/n [sum(FFT(trial i))])}^2 =
>>
>> {1/n sum (FFT(trial i - ERF)) }^2 =
>>
>> {1/n sum (FFT(trial i)) - FFT(ERF)) }^2 =
>>
>> {1/n sum (FFT(trial i)) - 1/n n FFT(ERF) }^2 =
>>
>> {FFT(1/n sum (trial i)) - FFT(ERF)}^2 =
>>
>> {FFT(ERF) - FFT(ERF)}^2 = 0
>>
>>
>> Could you let me know where I misunderstand that approach?
>>
>> With regards to something like the ERF being present in every single
>> trial, I was thinking of other mechanisms like phase-reset or asymetric
>> modulations of oscillation amplitude that may or may not be detected by
>> looking at power increases.
>>
>> Michael
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Thomas Witzel <twitzel at NMR.MGH.HARVARD.EDU>
>> Gesendet: Apr 6, 2010 5:56:53 PM
>>  An: FIELDTRIP at NIC.SURFNET.NL
>> Betreff: Re: [FIELDTRIP] Induced activity
>>
>> >
>> >Maybe I wasn't clear. The trick is to maintain the
>> >complex components (real and imag) after the wavelet transform, then to
>> >separate induced and evoked and then to calculate power in the end.
>> >This can be done with entire TFRs that way. I'm not sure whether this is
>> >possible in the regular fieldtrip workflow which might cause confusion
>> with
>> >terminology here.
>> >As for the ERF not reflecting activity that might not be present in this
>> >form in the trials, I guess we have a bit of a philosophical question
>> >here. The entire premise of an ERF is that the brain response is
>> identical
>> >in every trial + some noise. Since EEG/MEG is extremely noisy you can't
>> >tell from single trials whats really going on, so averaging all trials
>> >could be the best estimation of what the signal in every trial looks
>> like.
>> >Now, of course we know that this is not entirely true, because in many
>> >experiments we know of systematic trial to trial variation, in which
>> >case the whole ERF or for that matter most common analysis methods are
>> >inappropriate.
>> >Also, even if there is random trial to trial variation, some of it might
>> >not be noise, as already described by Schimmel back in 1967 in a nice
>> >Science article. This is where the induced signal comes in. For me its
>> >signal that can be detected by its respective increase or decrease in
>> >power, but its not coherent across trials so it cancels mostly in ERFs.
>> >Now subtracting the ERF from every trial brings the assumption back in
>> >that the evoked signal is the same in every trial which it might be or
>> >might not be. In most of the experiments I have analyzed subaverages
>> >(separate even and odd trials, or early and late ones) were very similar,
>> >so the assumption that the evoked response is the same in every trial was
>> >fair.
>> >Practically I found that subtracting the ERF or not, has very little
>> >impact on the final outcome, but I didn't test every case, so I'm
>> >subtracting where its deemed appropriate....
>> >
>> >Thomas
>> >
>>
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100407/9d99ebee/attachment.htm>

From lhunt at FMRIB.OX.AC.UK  Wed Apr  7 12:03:43 2010
From: lhunt at FMRIB.OX.AC.UK (Laurence Hunt)
Date: Wed, 7 Apr 2010 11:03:43 +0100
Subject: Oxford conference on Motivational and Cognitive Control,
 2nd-4th June
Message-ID: <WED.7.APR.2010.110343.0100.FIELDTRIP@NIC.SURFNET.NL>

Please find below a message from Jerome Sallet concerning a conference to be held in Oxford immediately prior to HBM.

Best wishes,
Laurence Hunt

===========================================

Dear colleague,

We would like to draw your attention to a symposium we are organizing on
the Neural Basis of Motivational and Cognitive Control.

The symposium "Motivational and Cognitive Control" is to be held in
Oxford (UK), in St John's College on the 2nd-4th June 2010 (just before
the Human Brain Mapping meeting in Barcelona). The goal of the meeting
is to bring together researchers from a wide range of research
backgrounds to facilitate communication between different subfields and
foster collaborations between these researchers.

The meeting will be characterized by a small-scale, informal setting.
200 participants will be present, representing a mixture of very
high-profile speakers, all of whom are pioneers in their respective
fields, and young up-and-coming researchers. Reflecting the wide range
of fields involved, we aim to bring together experimental psychologists,
neurologists, neuroanatomists, neurobiologists, and computational
neuroscientists, who will focus both on their latest research results as
well as on their research techniques. Previous meetings have proven that
this formula of integration fosters exciting interdisciplinary ideas and
new collaborations.

Day one of the conference will survey the broader research context,
focusing on topics with are very relevant to the discussion but that are
traditionally neglected in meetings on brain function, such as zoology,
economics, neuroanatomy and developmental science. The afternoon will
draw in research on humans. Day two of the conference will discuss on
cutting-edge research on motivational and cognitive control in humans
and animals. The morning will focus on research in animals with a
specific emphasis on the role dopamine function in decision making. The
afternoon session will dove-tail with this, by discussing research on
healthy humans and patient populations. Day three will consider the
computational approaches to understanding neural processes related to
motivational and cognitive control.

Each day will feature a number of talks by senior researchers, a poster
session to allow younger researchers (M.Sc. students, Ph.D. students,
Post-docs) to present their work, and discussion time for all
participants. Day one will be followed by a reception; day two will be
followed by a conference dinner for all participants.

More information as well as registration information can be found at
http://www.rbmars.dds.nl/MFC2010/index.htm

We hope we'll see you at what we are sure will be an exciting meeting.

Sincerely,

Rogier Mars, Jerome Sallet, Matthew Rushworth, Nick Yeung

-- 
__________________________________________________
Jerome SALLET

Decision and Action Laboratory

Department of Experimental Psychology,
University of Oxford

South Parks Road, OX1 3UD,UK

Tel (office): (0044) 1865 271 315
Tel (elsewhere) : (0044) 7 530 060 839


http://psyweb.psy.ox.ac.uk/rushworth/default.htm


Motivational and Cognitive Control Conference, 2nd-4th June 2010, Oxford
http://www.rbmars.dds.nl/MFC2010/index.htm


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100407/c6d557bf/attachment.htm>

From zd8472 at GMAIL.COM  Wed Apr  7 15:59:02 2010
From: zd8472 at GMAIL.COM (Dan Zhang)
Date: Wed, 7 Apr 2010 21:59:02 +0800
Subject: Failure of recognizing 32-bit NeuroScan data
Message-ID: <WED.7.APR.2010.215902.0800.FIELDTRIP@NIC.SURFNET.NL>

Hello,

I've encountered a problem of loading the 32-bit NeuroScan data into
FieldTrip.

After one day debugging, I found out that the data was wrongly recognized as
16bit, which made all the things in the wrong place. I manually made some
changes in several m-files to make it work for my current dataset by
assigning all the processing in a 32-bit way, which cannot be the final
solution.

Anyone tell me how to automatically recognize the version of the data? Then
I can try to fix this bug.

Yet here is another small problem: the imported NeuroScan data may not be
with the correct unit (e.g. uV). I know the loadcnt() function can be evoked
with 'scale' = 'on', but it seemed that this parameter was not used in the
current version of FiledTrip.

Best regards,
Dan

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100407/784342f7/attachment.htm>

From Patricia.Wollstadt at GMX.DE  Wed Apr  7 15:58:20 2010
From: Patricia.Wollstadt at GMX.DE (Patricia Wollstadt)
Date: Wed, 7 Apr 2010 15:58:20 +0200
Subject: freqstatistics
Message-ID: <WED.7.APR.2010.155820.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear list members,

I am trying to calculate the statistics for four groups in a resting state condition.
The problem is that mask and statmask do not match the plotted statistics (see attached figure, topoplotTFR with zparam='stat', zparam='mask', zparam='statmask'). At this point the groups only consist of 8 participants per group and I am now wondering, whether the problem is caused by the low group size or a failure in the skript (I apologize for the quantity of code, but I followed the tutorial very closely and couldn't find an error so far):

cfg=[];
cfg.grad=grad;
cfg.layout=prepare_layout(cfg);
cfg.method    = 'montecarlo';
cfg.channel   = myChannels;
cfg.statistic = 'indepsamplesF';
cfg.correctm  = 'fdr';
cfg.numrandomization = 1000;
cfg.tail = 0;
cfg.alpha = 0.05;
cfg.parameter='powspctrm';
cfg.avgoverfreq = 'no';
cfg.avgovertime = 'yes';

design = [1:groupSize 1:groupSize 1:groupSize 1:groupSize];
design(2,:) = [ones(1,groupSize) 2*ones(1,groupSize) 3*ones(1,groupSize) 4*ones(1,groupSize)];

cfg.design=design;
cfg.uvar = 1;
cfg.ivar = 2;

cfg.frequency   = [40 180];
statisticsGamma = freqstatistics(cfg,group1avg,group2avg,group3avg,group4avg);

statisticsGamma.statmask=(statisticsGamma.stat).*(statisticsGamma.mask);


Thanks and best regards
Patricia Wollstadt
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: statisticsTFRgamma.png
Type: image/png
Size: 23405 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100407/d48a8a90/attachment.png>

From daz at MIT.EDU  Wed Apr  7 20:53:27 2010
From: daz at MIT.EDU (David Ziegler)
Date: Wed, 7 Apr 2010 14:53:27 -0400
Subject: neuromag vectorview 306 triggers
Message-ID: <WED.7.APR.2010.145327.0400.FIELDTRIP@NIC.SURFNET.NL>

Hi Fieldtrippers,

I am trying to use FT to analyze data collected form a Neuromag Vectorview 306
and am trying to figure out the proper way to read all of my triggers.  The
wiki noted that the old function read_trigger treated trigger values below 5 as
noise.  I tried using ft_definetrial, and it appears to ignore these values as
well. This is the output I get when searching for readable triggers:

>Reading 22200 ... 269399  =     36.962 ...   448.539 secs... [done]
>the following events were found in the datafile
>event type: 'STI 001' with event values: 5
>event type: 'STI 002' with event values: 5
>event type: 'STI 003' with event values: 5
>event type: 'STI 004' with event values: 5
>event type: 'STI 005' with event values: 5
>event type: 'STI 006' with event values: 5
>event type: 'STI 014' with event values: 5   6   7   8   9  10  11  16  32
>no trials have been defined yet, see DEFINETRIAL for further help
>found 882 events
>created 0 trials

My design uses all trigger values from 1-11 and 16 and 32, so I am hoping there
is a way to read trigger values 1-4 somehow.

Thanks!
David

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From dahliash at STANFORD.EDU  Thu Apr  8 07:46:30 2010
From: dahliash at STANFORD.EDU (Dahlia Sharon)
Date: Wed, 7 Apr 2010 22:46:30 -0700
Subject: importing vol and grid for beamforming (ft_sourceanalysis)
Message-ID: <WED.7.APR.2010.224630.0700.FIELDTRIP@NIC.SURFNET.NL>

Hi,

I would like to use beamforming, and have the forward solution and BEMs produced from MNE/FreeSurfer. Rather than resegment the data from scratch, I would like to import the results I already have.

Reading the tutorial and reference documentation, I see that I need to give ft_sourceanalysis a cfg structure containing vol and grid fields (the latter being itself a structure). However it isn't clear to me what these fields should contain exactly.

Can someone clarify please?

Thanks!
Dahlia.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100407/5b4b78d9/attachment.htm>

From masaki.maruyama at CEA.FR  Thu Apr  8 10:52:38 2010
From: masaki.maruyama at CEA.FR (MARUYAMA Masaki INSERM)
Date: Thu, 8 Apr 2010 10:52:38 +0200
Subject: neuromag vectorview 306 triggers
In-Reply-To: A<20100407145327.tsgn5rk0lc0s804o@webmail.mit.edu>
Message-ID: <THU.8.APR.2010.105238.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear David,


I don't remember if signals of STI001-008 are binary (0 or 1) or analogue in voltage unit. And I couldn't understand why you read 'STI014'. However, I would like to recommend you to read trigger signal of STI101 and not STI001-008. The STI101 signal ranges between 0 and 256, which is a combined signal across binary data of STI001-008. 

I attached a part of my script in "trialfun.m". If you implement in your trialfun and declare the trigger channel as STI101, I think you will find your trigger values of 5, 6, ..., 32 in the variable "trig". Please note that the trigger signals sometimes take few time slices to change its value. For example, when your stimulus PC changed trigger value from 0 to 32, recorded trigger value might increase like 0->16->32 and not 0->32. So, you may need to add your own commands to fix this issue according to your recording condition.


With best regards,
Masaki Maruyama 

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

% read the header and event information
hdr = read_header(cfg.dataset); 

% read trigger signal
B = read_data(cfg.dataset, 'chanindx',... strmatch(cfg.trialdef.channel,hdr.label,'exact')); 

%get rid of the offsets that are an integer number of 8192
trig=mod(B,8192);

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


>-----Message d'origine-----
>De : FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] De la part
>de David Ziegler
>Envoyé : mercredi 7 avril 2010 20:53
>À : FIELDTRIP at NIC.SURFNET.NL
>Objet : [FIELDTRIP] neuromag vectorview 306 triggers
>
>Hi Fieldtrippers,
>
>I am trying to use FT to analyze data collected form a Neuromag Vectorview
>306
>and am trying to figure out the proper way to read all of my triggers.  The
>wiki noted that the old function read_trigger treated trigger values below
>5 as
>noise.  I tried using ft_definetrial, and it appears to ignore these values
>as
>well. This is the output I get when searching for readable triggers:
>
>>Reading 22200 ... 269399  =     36.962 ...   448.539 secs... [done]
>>the following events were found in the datafile
>>event type: 'STI 001' with event values: 5
>>event type: 'STI 002' with event values: 5
>>event type: 'STI 003' with event values: 5
>>event type: 'STI 004' with event values: 5
>>event type: 'STI 005' with event values: 5
>>event type: 'STI 006' with event values: 5
>>event type: 'STI 014' with event values: 5   6   7   8   9  10  11  16  32
>>no trials have been defined yet, see DEFINETRIAL for further help
>>found 882 events
>>created 0 trials
>
>My design uses all trigger values from 1-11 and 16 and 32, so I am hoping
>there
>is a way to read trigger values 1-4 somehow.
>
>Thanks!
>David
>
>----------------------------------
>The aim of this list is to facilitate the discussion between users of the
>FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
>and EEG analysis. See also
>http://listserv.surfnet.nl/archives/fieldtrip.html and
>http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From v.litvak at ION.UCL.AC.UK  Thu Apr  8 16:49:49 2010
From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak)
Date: Thu, 8 Apr 2010 15:49:49 +0100
Subject: Failure of recognizing 32-bit NeuroScan data
In-Reply-To: <l2ze966c9b21004070659sfad1720ao455dc9484a9d5220@mail.gmail.com>
Message-ID: <THU.8.APR.2010.154949.0100.FIELDTRIP@NIC.SURFNET.NL>

Dear Dan,

On Wed, Apr 7, 2010 at 2:59 PM, Dan Zhang <zd8472 at gmail.com> wrote:

> I've encountered a problem of loading the 32-bit NeuroScan data into
> FieldTrip.
>
> After one day debugging, I found out that the data was wrongly recognized as
> 16bit, which made all the things in the wrong place. I manually made some
> changes in several m-files to make it work for my current dataset by
> assigning all the processing in a 32-bit way, which cannot be the final
> solution.
> Anyone tell me how to automatically recognize the version of the data? Then
> I can try to fix this bug.

This is not a bug but a known issue. Until now we have not found any
way to automatically distinguish between 32-bit and 16-bit Neuroscan
data. This problem is also not solved in EEGLAB where the reader
originates and the user has to specify it via the GUI. What you can do
in your code that will not require modifying Fieldtrip code is specify
in configuration of ft_preprocessing:

cfg.headerformat = 'ns_cnt32';
cfg.dataformat = 'ns_cnt32';

Similarly if you use read_header, read_data or read_event there is an
optional input argument for data format that you can use. If you come
up with a way to distinguish automatically the two format variants
we'd be happy to hear about it.

>
> Yet here is another small problem: the imported NeuroScan data may not be
> with the correct unit (e.g. uV). I know the loadcnt() function can be evoked
> with 'scale' = 'on', but it seemed that this parameter was not used in the
> current version of FiledTrip.
>

'scale' = 'on' is default in loadcnt so there is no need to set it
explicitly in Fieldtrip functions.

Best,

Vladimir

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From michael.wibral at WEB.DE  Thu Apr  8 17:42:08 2010
From: michael.wibral at WEB.DE (Michael Wibral)
Date: Thu, 8 Apr 2010 17:42:08 +0200
Subject: freqstatistics
In-Reply-To: <20100407135820.241450@gmx.net>
Message-ID: <THU.8.APR.2010.174208.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Patricia,

from looking at your plots I see that you average over the whole frequency range analysed (40-180). Only a few frequency bands seem to carry a significant effect - hence the small units, when displaying the mask (0.0426 is the maximum already!). I suggest you try to indetify the frequency band with the geratest effect and then compare stat/mask/statmask again. In the statmaskplot you're amplifying the effect by multiplying mask and (tiny) effects.

What might seem odd for you is that some sensor has a high t-value (averaged over frequencies) while it has a very low value in the average mask. But this can happen:
Imagine your frequencies being:
f = [40 42 ...178 180]      (70 entries)

the t-values at that sensor for each frequency are
stat(sensor,:) = [ 0 0 ....... 0 70]    (70 entries, one for each frequency, only one is nonzero)
The average over all frequencies (which you plot) in this case is 70/70=1

The mask will be
mask(sensor,:) = [0 0 ....... 0 1] (70entries, one for each frequency, only one is nonzero)
he average over all frequencies (which you plot) in this case is 1/70 i.e. a tiny value!

Therefore plotting t-stats averaged over frequencies and the mask averaged over frequencies may give very different results.

Michael




-----Ursprüngliche Nachricht-----
Von: Patricia Wollstadt 
Gesendet: Apr 7, 2010 3:58:20 PM
An: FIELDTRIP at NIC.SURFNET.NL
Betreff: [FIELDTRIP] freqstatistics

>Dear list members,
>
>I am trying to calculate the statistics for four groups in a resting state condition. 
>The problem is that mask and statmask do not match the plotted statistics (see attached figure, topoplotTFR with zparam='stat', zparam='mask', zparam='statmask'). At this point the groups only consist of 8 participants per group and I am now wondering, whether the problem is caused by the low group size or a failure in the skript (I apologize for the quantity of code, but I followed the tutorial very closely and couldn't find an error so far): 
>
>cfg=[];
>cfg.grad=grad; 
>cfg.layout=prepare_layout(cfg);
>cfg.method    = 'montecarlo';
>cfg.channel   = myChannels; 
>cfg.statistic = 'indepsamplesF'; 
>cfg.correctm  = 'fdr'; 
>cfg.numrandomization = 1000;
>cfg.tail = 0;
>cfg.alpha = 0.05;
>cfg.parameter='powspctrm';
>cfg.avgoverfreq = 'no';
>cfg.avgovertime = 'yes';
>
>design = [1:groupSize 1:groupSize 1:groupSize 1:groupSize];             
>design(2,:) = [ones(1,groupSize) 2*ones(1,groupSize) 3*ones(1,groupSize) 4*ones(1,groupSize)];
>
>cfg.design=design;
>cfg.uvar = 1;       
>cfg.ivar = 2;       
>
>cfg.frequency   = [40 180];                 
>statisticsGamma = freqstatistics(cfg,group1avg,group2avg,group3avg,group4avg);
>
>statisticsGamma.statmask=(statisticsGamma.stat).*(statisticsGamma.mask);    
>
>
>Thanks and best regards
>Patricia Wollstadt
>-- 
>GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
>----------------------------------
>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Michael Wibral.vcf
Type: text/x-vcard
Size: 628 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100408/9c698ac2/attachment.vcf>

From zd8472 at GMAIL.COM  Fri Apr  9 03:52:55 2010
From: zd8472 at GMAIL.COM (Dan Zhang)
Date: Fri, 9 Apr 2010 03:52:55 +0200
Subject: Failure of recognizing 32-bit NeuroScan data
Message-ID: <FRI.9.APR.2010.035255.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Vladimir,

Thank you very much for your information！ Now everything is clear :-)

Best,
Dan

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From zd8472 at GMAIL.COM  Fri Apr  9 05:34:46 2010
From: zd8472 at GMAIL.COM (Dan Zhang)
Date: Fri, 9 Apr 2010 05:34:46 +0200
Subject: Failure of recognizing 32-bit NeuroScan data
Message-ID: <FRI.9.APR.2010.053446.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi,

I found another problem regarding my data following the above suggestions.
Although ft_preprocessing can work well with the 32-bit data with the manual
input, ft_definetrial and ft_artifact_eog (and other reading related
functions) are not compatible with the 32-bit NeuroScan processing. 

For example, in line 105 of ft_artifact_zvalue.m, the read_header() function
was evoked without the 'headerformat' parameter.
There are several other places with the same problem, I listed what I can
find below:

line 50, trialfun_general.m - read_header(), check if headerformat is provided 
line 59, trialfun_general.m - read_event(), check if headerformat is provided 
line 105 & 1152, read_event.m - the reading of neuroscan data is based on a
new parameter called eventformat, which is not connected to the headerformat
line 149, ft_artifact_zvalue.m - check if headerformat and dataformat are
provided
line 661, read_data - if the field of dataformat already exists, do not
override it

I cannot guarantee that all the places were found, but at least my data can
be loaded correctly if the above places were fixed. 

Best,
Dan

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From sangita.dandekar at GMAIL.COM  Fri Apr  9 18:29:52 2010
From: sangita.dandekar at GMAIL.COM (Sangita Dandekar)
Date: Fri, 9 Apr 2010 12:29:52 -0400
Subject: beamformer on yokogawa data, grad.tra structure
Message-ID: <FRI.9.APR.2010.122952.0400.FIELDTRIP@NIC.SURFNET.NL>

Hi Vladimir and Fieldtrip list,

Thanks for the below reply!   I was wondering if you or anyone familiar with
the yokogawa MEG system
could verify that we are using an appropriate grad.tra matrix and then
subsequently determining the channel leadfield
from grad.tra correctly.   Currently, we are using the generic  definition
for the grad.tra matrix from the yokogawa2grad.m
file in the private fieldtrip directory:

% Define the pair of 1st and 2nd coils for each gradiometer
grad.tra = repmat(diag(ones(1,size(grad.pnt,1)/2),0),1,2);

% Make the matrix sparse to speed up the multiplication in the forward
% computation with the coil-leadfield matrix to get the channel leadfield
grad.tra = sparse(grad.tra);

Each of our channels is an axial gradiometer with two coils so I think that
the above definition should be fine, but
just wanted to check to be sure.

One possibly complicating factor is that MEG160, the software that we use
for data collection with the yokogawa system, has a list of
'calibration weights' for each gradiometer that are determined at each
sensor tuning prior to data collection.  There is one calibration
weight determined per channel (or 1 weight for every pair of coils).  Do
these calibration weights need to be accounted for when
determining grad.tra or the channel leadfield?

Thanks!
Sangi


On Tue, Feb 2, 2010 at 2:07 PM, Vladimir Litvak <v.litvak at ion.ucl.ac.uk>wrote:

> Dear Sangi,
>
> There is no need to convert your data to planar gradient. The
> assumption is that the relation between coils and channels is
> described by the grad.tra matrix. You can look at it and make sure it
> is correct for your system (write back if not). The megplanar function
> as apparent from the error message has explicit support for some
> particular MEG systems and Yokogawa is not one of those. I'm not sure
> how easy it would be to support it generically as there might be
> several variants of Yokogawa systems which can be quite hard to
> distinguish. But for your particular system you can try to implement
> it yourself.
>
> Best,
>
> Vladimir
>
> On Tue, Feb 2, 2010 at 5:22 PM, Sangita Dandekar
> <sangita.dandekar at gmail.com> wrote:
> > Hi,
> > Am hoping to apply beamforming based source localization to MEG data from
> a
> > Yokogawa system.   Think I've managed to coregister MRI and sensor
> > coordinate systems, so that part of the problem is pretty much under
> > control.
> > What I'm wondering about is what the assumptions are of the
> > prepare_leadfield and other source localization scripts about the input
> > gradiometer data.  Haven't looked at it too closely yet, but does it
> assume
> > that the input sensor data is planar gradient data?  If so am assuming
> that
> > inputting the raw data from the Yokogawa system (axial gradiometers) is
> > incorrect?   Or does fieldtrip distinguish between different types of
> > gradiometers using the input .grad structure?
> > I tried to convert the axial gradiometer data from the yokogawa system to
> > planar gradient data by using the megplanar function as shown below, and
> > receive the following error:
> > (Even if it isn't necessary for source localization, it would be nice to
> be
> > able to view the data as planar gradient data)
> >>> cfg=[];
> >>> cfg.planarmethod='sincos';
> >>> megplanar(cfg, righttrials);
> > the input is raw data with 156 channels and 46 trials
> > ??? Error using ==> checkdata at 478
> > This function requires ctf151, ctf275, bti148 or bti248 data as input,
> but
> > you are giving meg data.
> > Error in ==> megplanar at 228
> > data  = checkdata(data, 'datatype', {'raw' 'freq'}, 'feedback', 'yes',
> > 'ismeg', 'yes', 'senstype', {'ctf151', 'ctf275',
> > 'bti148', 'bti248'});
> >>>
> > Some background information:  used the ft yokogawa2grad.m function
> (stored
> > in private FT directory) to create the gradient structure.  Here is what
> > data structure for
> > one set of trials looks like:
> >>> righttrials
> > righttrials =
> >       trial: {1x46 cell}
> >       label: {1x156 cell}
> >        time: {1x46 cell}
> >     fsample: 500
> >        grad: [1x1 struct]
> >      offset: [46x46 double]
> >         cfg: [1x1 struct]
> >>> righttrials.grad
> > ans =
> >       pnt: [314x3 double]
> >       ori: [314x3 double]
> >       tra: [157x314 double]
> >     label: {157x1 cell}
> >      unit: 'cm'
> >>>
> >
> >
> > Thanks in advance for any help!
> > Sangi
> >
> >
> >
> > ----------------------------------
> >
> > The aim of this list is to facilitate the discussion between users of the
> > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG
> and
> > EEG analysis.
> >
> > http://listserv.surfnet.nl/archives/fieldtrip.html
> >
> > http://www.ru.nl/fcdonders/fieldtrip/
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
> and EEG analysis. See also
> http://listserv.surfnet.nl/archives/fieldtrip.html and
> http://www.ru.nl/neuroimaging/fieldtrip.
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100409/bf5408d4/attachment.htm>

From dahliash at STANFORD.EDU  Fri Apr  9 19:54:46 2010
From: dahliash at STANFORD.EDU (Dahlia Sharon)
Date: Fri, 9 Apr 2010 19:54:46 +0200
Subject: importing vol and grid for beamforming (ft_sourceanalysis)
Message-ID: <FRI.9.APR.2010.195446.0200.FIELDTRIP@NIC.SURFNET.NL>

On the same topic, is it possible to use a 3-layer BEM or only a 1-layer BEM?

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From jdien07 at MAC.COM  Mon Apr 12 04:29:55 2010
From: jdien07 at MAC.COM (Joseph Dien)
Date: Sun, 11 Apr 2010 22:29:55 -0400
Subject: regularization constant for ft_dipolefitting?
Message-ID: <SUN.11.APR.2010.222955.0400.FIELDTRIP@NIC.SURFNET.NL>

What is the regularization constant used by the ft_dipolefitting routine?

Thanks!

Joe

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

Joseph Dien,
Senior Research Scientist
Center for Advanced Study of Language
University of Maryland
7005 52nd Avenue
College Park, MD 20742-0025

E-mail: jdien07 at mac.com
Phone: 301-226-8848
Fax: 301-226-8811
http://homepage.mac.com/jdien07/

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From keithlee0323 at GMAIL.COM  Mon Apr 12 04:41:43 2010
From: keithlee0323 at GMAIL.COM (Lee, Gwan-Taek)
Date: Mon, 12 Apr 2010 11:41:43 +0900
Subject: about time-frequency analysis using wavelet transform
Message-ID: <MON.12.APR.2010.114143.0900.FIELDTRIP@NIC.SURFNET.NL>

Dear fieldtrip users.

I'm going to make an TFA analysis using 'wltconvol' of an ERP data that have
just 200ms baseline.
If I observe frequency between 4~30 Hz, wavelet cycles(cfg.width) has to be
only 1 because of short baseline. ( cycle / freq = window length )
Is using only 1 wavelet cycle alright?
I think some correction is needed. exp^(-w0/2) has to be subtracted from
exp^(jw0t) on motehr wavelet equation.
Is there this correection in fieldtrip TFA method?


Best..



--
Lee, Gwan-Taek, Master Course
Biomedical Engineering, Korea University College of Medicine
Department of Neurology, Korea University Medical Center,
KU Computational Neuroscience Research Lab (http://eeg.re.kr)
126-1, 5-Ga, Anam-Dong, Sungbuk-Gu, Seoul 136-705, Korea
Tel 82-2-920-6598
Mobile: 010-2352-7517
VolP: 070-8285-6598sp

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100412/468b9604/attachment.htm>

From zaifengg at GMAIL.COM  Mon Apr 12 15:55:22 2010
From: zaifengg at GMAIL.COM (gao zai)
Date: Mon, 12 Apr 2010 16:55:22 +0300
Subject: Questions on sourceinterpolate after the sourcestatistics
Message-ID: <MON.12.APR.2010.165522.0300.FIELDTRIP@NIC.SURFNET.NL>

Dear all,

I am now working on the sourcestatistics of the LCMV beamfomer. After
finished the volumenormalisation, sourcegrandaverage and sourcestatistics,
now I want to plot the t-values to the anatomical MRI. However, when I run
the ft_sourceinterpolate (codes see below), I wait for hours and response
with the matlab informing that "reslicing and interpolating
negclusterslabelmat "
--------------------------------------
%%statistics on the grandaverage
cfg=[];
cfg.dim         = gs42.dim;
cfg.parameter   = 'nai';
cfg.method      = 'montecarlo';
cfg.statistic   = 'depsamplesT';
cfg.correctm    = 'cluster';
cfg.numrandomization = 100;
cfg.alpha       = 0.05;
cfg.tail        = 0;

nsubj=length(gs42.trial);
cfg.design(1,:) = [ones(1,nsubj) ones(1,nsubj)*2];
cfg.design(2,:) = [1:nsubj 1:nsubj];

cfg.ivar        = 1; % row of design matrix that contains independent
variable (the conditrions)
cfg.uvar        = 2; % row of design matrix that contains subjects number-2
groups

stat = sourcestatistics(cfg, gs42,gs50);

sMRI = read_mri(fullfile(spm('dir'), 'canonical', 'single_subj_T1.nii'));
cfg = [];
cfg.downsample = 2;
cfg.parameter = 'all';
statplot = ft_sourceinterpolate(cfg, stat, sMRI);
--------------------------------------------------------------------------------------

Does anybody how to deal with it? Thanks a lot in advance.

Best,
FENG

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100412/24336b99/attachment.htm>

From r.oostenveld at FCDONDERS.RU.NL  Tue Apr 13 09:59:58 2010
From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld)
Date: Tue, 13 Apr 2010 09:59:58 +0200
Subject: Questions on sourceinterpolate after the sourcestatistics
In-Reply-To: <v2we2a4b17e1004120655s76137a16z345cdb20ecee3b8b@mail.gmail.com>
Message-ID: <TUE.13.APR.2010.095958.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Feng,

I suspect that your computer is running out of memory while it is
trying to interpolate all functional volumes onto the anatomical MRI
grid. Instead of specifying

cfg.parameter = 'all'

I suggest that you only specify those parameters that you want to have
interpolated. The negclusterslabelmat volume for example is not one
that you want to have interpolated.

best regards,
Robert

On 12 Apr 2010, at 15:55, gao zai wrote:

> Dear all,
>
> I am now working on the sourcestatistics of the LCMV beamfomer.
> After finished the volumenormalisation, sourcegrandaverage and
> sourcestatistics, now I want to plot the t-values to the anatomical
> MRI. However, when I run the ft_sourceinterpolate (codes see below),
> I wait for hours and response with the matlab informing that
> "reslicing and interpolating negclusterslabelmat "
> --------------------------------------
> %%statistics on the grandaverage
> cfg=[];
> cfg.dim         = gs42.dim;
> cfg.parameter   = 'nai';
> cfg.method      = 'montecarlo';
> cfg.statistic   = 'depsamplesT';
> cfg.correctm    = 'cluster';
> cfg.numrandomization = 100;
> cfg.alpha       = 0.05;
> cfg.tail        = 0;
>
> nsubj=length(gs42.trial);
> cfg.design(1,:) = [ones(1,nsubj) ones(1,nsubj)*2];
> cfg.design(2,:) = [1:nsubj 1:nsubj];
>
> cfg.ivar        = 1; % row of design matrix that contains
> independent variable (the conditrions)
> cfg.uvar        = 2; % row of design matrix that contains subjects
> number-2 groups
>
> stat = sourcestatistics(cfg, gs42,gs50);
>
> sMRI = read_mri(fullfile(spm('dir'), 'canonical',
> 'single_subj_T1.nii'));
> cfg = [];
> cfg.downsample = 2;
> cfg.parameter = 'all';
> statplot = ft_sourceinterpolate(cfg, stat, sMRI);
> --------------------------------------------------------------------------------------
>
> Does anybody how to deal with it? Thanks a lot in advance.
>
> Best,
> FENG
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From r.oostenveld at FCDONDERS.RU.NL  Tue Apr 13 10:04:09 2010
From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld)
Date: Tue, 13 Apr 2010 10:04:09 +0200
Subject: Failure of recognizing 32-bit NeuroScan data
In-Reply-To: <LISTSERV%201004090534464290.2F93@NIC.SURFNET.NL>
Message-ID: <TUE.13.APR.2010.100409.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Dan,

thanks for the suggestion. I have made a bugzilla ticket for it (http://bugzilla.fcdonders.nl/show_bug.cgi?id=65
) and it will be fixed in a upcoming version.

Robert


On 9 Apr 2010, at 5:34, Dan Zhang wrote:

> Hi,
>
> I found another problem regarding my data following the above
> suggestions.
> Although ft_preprocessing can work well with the 32-bit data with
> the manual
> input, ft_definetrial and ft_artifact_eog (and other reading related
> functions) are not compatible with the 32-bit NeuroScan processing.
>
> For example, in line 105 of ft_artifact_zvalue.m, the read_header()
> function
> was evoked without the 'headerformat' parameter.
> There are several other places with the same problem, I listed what
> I can
> find below:
>
> line 50, trialfun_general.m - read_header(), check if headerformat
> is provided
> line 59, trialfun_general.m - read_event(), check if headerformat is
> provided
> line 105 & 1152, read_event.m - the reading of neuroscan data is
> based on a
> new parameter called eventformat, which is not connected to the
> headerformat
> line 149, ft_artifact_zvalue.m - check if headerformat and
> dataformat are
> provided
> line 661, read_data - if the field of dataformat already exists, do
> not
> override it
>
> I cannot guarantee that all the places were found, but at least my
> data can
> be loaded correctly if the above places were fixed.
>
> Best,
> Dan
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip  toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html
>  and http://www.ru.nl/neuroimaging/fieldtrip.
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From r.oostenveld at FCDONDERS.RU.NL  Tue Apr 13 10:05:44 2010
From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld)
Date: Tue, 13 Apr 2010 10:05:44 +0200
Subject: importing vol and grid for beamforming (ft_sourceanalysis)
In-Reply-To: <894842167.1633921270705590637.JavaMail.root@zm09.stanford.edu>
Message-ID: <TUE.13.APR.2010.100544.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Dahlia

Please have a look here
http://fieldtrip.fcdonders.nl/example/use_your_own_forward_leadfield_model_in_an_inverse_beamformer_computation

best regards,
Robert


On 8 Apr 2010, at 7:46, Dahlia Sharon wrote:

> Hi,
>
> I would like to use beamforming, and have the forward solution and
> BEMs produced from MNE/FreeSurfer. Rather than resegment the data
> from scratch, I would like to import the results I already have.
>
> Reading the tutorial and reference documentation, I see that I need
> to give ft_sourceanalysis a cfg structure containing vol and grid
> fields (the latter being itself a structure). However it isn't clear
> to me what these fields should contain exactly.
>
> Can someone clarify please?
>
> Thanks!
> Dahlia.
> ----------------------------------
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis.
> http://listserv.surfnet.nl/archives/fieldtrip.html
> http://www.ru.nl/fcdonders/fieldtrip/

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From r.oostenveld at FCDONDERS.RU.NL  Tue Apr 13 10:12:21 2010
From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld)
Date: Tue, 13 Apr 2010 10:12:21 +0200
Subject: beamformer on yokogawa data, grad.tra structure
In-Reply-To: <j2kc704a3da1004090929ha7011b01l51c0706648e6ab10@mail.gmail.com>
Message-ID: <TUE.13.APR.2010.101221.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Sangi

On 9 Apr 2010, at 18:29, Sangita Dandekar wrote:
> Thanks for the below reply!   I was wondering if you or anyone
> familiar with the yokogawa MEG system
> could verify that we are using an appropriate grad.tra matrix and
> then subsequently determining the channel leadfield
> from grad.tra correctly.   Currently, we are using the generic
> definition for the grad.tra matrix from the yokogawa2grad.m
> file in the private fieldtrip directory:
>
> % Define the pair of 1st and 2nd coils for each gradiometer
> grad.tra = repmat(diag(ones(1,size(grad.pnt,1)/2),0),1,2);
>
> % Make the matrix sparse to speed up the multiplication in the forward
> % computation with the coil-leadfield matrix to get the channel
> leadfield
> grad.tra = sparse(grad.tra);
>
> Each of our channels is an axial gradiometer with two coils so I
> think that the above definition should be fine, but
> just wanted to check to be sure.

To check you could do the following

figure
hold on
axis vis3d
for i=1:160
   coils = find(grad.tra(i,:));
   coil1 = coils(1);
   coil2 = coils(2);
   plot3(grad.pnt(coil1,1), grad.pnt(coil1,2), grad.pnt(coil1,3), 'b.');
   plot3(grad.pnt(coil2,1), grad.pnt(coil2,2), grad.pnt(coil2,3), 'r.');
   disp('press return to continue')
   pause
end

which will visualise all coil pairs.


> One possibly complicating factor is that MEG160, the software that
> we use for data collection with the yokogawa system, has a list of
> 'calibration weights' for each gradiometer that are determined at
> each sensor tuning prior to data collection.  There is one calibration
> weight determined per channel (or 1 weight for every pair of
> coils).  Do these calibration weights need to be accounted for when
> determining grad.tra or the channel leadfield?

no the calibration weights are used when reading in the data from disk
into memory. In the forward computation (and inverse computation) they
should not be used.


best,
Robert

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From zaifengg at GMAIL.COM  Tue Apr 13 16:32:30 2010
From: zaifengg at GMAIL.COM (gao zai)
Date: Tue, 13 Apr 2010 17:32:30 +0300
Subject: Questions on sourceinterpolate after the sourcestatistics
In-Reply-To: <4CE410A6-4EA5-4EDE-8FCA-FB0618246B5C@fcdonders.ru.nl>
Message-ID: <TUE.13.APR.2010.173230.0300.FIELDTRIP@NIC.SURFNET.NL>

Thank you very much Robert. I tried your suggestion, and set the
cfg.parameter='stat', still it gets stuck. As you mentioned, it maybe out of
memory. I am now trying to change to a powerful one.


Feng

On Tue, Apr 13, 2010 at 10:59 AM, Robert Oostenveld <
r.oostenveld at fcdonders.ru.nl> wrote:

> Dear Feng,
>
> I suspect that your computer is running out of memory while it is trying to
> interpolate all functional volumes onto the anatomical MRI grid. Instead of
> specifying
>
> cfg.parameter = 'all'
>
> I suggest that you only specify those parameters that you want to have
> interpolated. The negclusterslabelmat volume for example is not one that you
> want to have interpolated.
>
> best regards,
> Robert
>
>
> On 12 Apr 2010, at 15:55, gao zai wrote:
>
>  Dear all,
>>
>> I am now working on the sourcestatistics of the LCMV beamfomer. After
>> finished the volumenormalisation, sourcegrandaverage and sourcestatistics,
>> now I want to plot the t-values to the anatomical MRI. However, when I run
>> the ft_sourceinterpolate (codes see below), I wait for hours and response
>> with the matlab informing that "reslicing and interpolating
>> negclusterslabelmat "
>> --------------------------------------
>> %%statistics on the grandaverage
>> cfg=[];
>> cfg.dim         = gs42.dim;
>> cfg.parameter   = 'nai';
>> cfg.method      = 'montecarlo';
>> cfg.statistic   = 'depsamplesT';
>> cfg.correctm    = 'cluster';
>> cfg.numrandomization = 100;
>> cfg.alpha       = 0.05;
>> cfg.tail        = 0;
>>
>> nsubj=length(gs42.trial);
>> cfg.design(1,:) = [ones(1,nsubj) ones(1,nsubj)*2];
>> cfg.design(2,:) = [1:nsubj 1:nsubj];
>>
>> cfg.ivar        = 1; % row of design matrix that contains independent
>> variable (the conditrions)
>> cfg.uvar        = 2; % row of design matrix that contains subjects
>> number-2 groups
>>
>> stat = sourcestatistics(cfg, gs42,gs50);
>>
>> sMRI = read_mri(fullfile(spm('dir'), 'canonical', 'single_subj_T1.nii'));
>> cfg = [];
>> cfg.downsample = 2;
>> cfg.parameter = 'all';
>> statplot = ft_sourceinterpolate(cfg, stat, sMRI);
>>
>> --------------------------------------------------------------------------------------
>>
>> Does anybody how to deal with it? Thanks a lot in advance.
>>
>> Best,
>> FENG
>> ----------------------------------
>>
>> The aim of this list is to facilitate the discussion between users of the
>> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
>> EEG analysis.
>>
>> http://listserv.surfnet.nl/archives/fieldtrip.html
>>
>> http://www.ru.nl/fcdonders/fieldtrip/
>>
>>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
> and EEG analysis. See also
> http://listserv.surfnet.nl/archives/fieldtrip.html and
> http://www.ru.nl/neuroimaging/fieldtrip.
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100413/3579ecf8/attachment.htm>

From stojanoski at UTSC.UTORONTO.CA  Tue Apr 13 22:16:09 2010
From: stojanoski at UTSC.UTORONTO.CA (Bobby Stojanoski)
Date: Tue, 13 Apr 2010 16:16:09 -0400
Subject: Reference to non-existent field 'component'
Message-ID: <TUE.13.APR.2010.161609.0400.FIELDTRIP@NIC.SURFNET.NL>

Hello Everyone,



Thank you to everyone who responded to my earlier questions, the ensuing
conversation was extremely helpful!



I was hoping to get some help sorting out the following issue. I am trying
to plot significant clusters using ft_clusterplot, however with each attempt
I get this error message:

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



Error in ==> ft_topoplotER at 449

elseif ~isempty(cfg.component),



Error in ==> topoplotER at 17

[varargout{1:nargout}] = funhandle(varargin{:});



Error in ==> ft_clusterplot at 287

          topoplotER(cfgtopo, stat);



Error in ==> clusterplot at 17

[varargout{1:nargout}] = funhandle(varargin{:});



Error in ==> freqStatistics at 162

clusterplot(cfg, stat_PF_Val_D_InVal_D);



I tried setting cfg.component = [] or to some value, before running
freqgrandaverage, before running ft_freqstatistics and before plotting using
clusterplot, each time I get the same error. What is the source of this
error, and how can I move on?. Any help is greatly appreciated!



Many thanks,

Bobby


--
Bobby Stojanoski
Ph.D. Candidate
CoNSens lab
Department of Psychology
University of Toronto Scarborough
stojanoski at utsc.utoronto.ca
www.utsc.utoronto.ca/~stojanoski

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100413/9a58cf91/attachment.htm>

From aardesta at UCLA.EDU  Wed Apr 14 02:16:37 2010
From: aardesta at UCLA.EDU (Allen Ardestani)
Date: Tue, 13 Apr 2010 17:16:37 -0700
Subject: Ultra-low Frequency Band-Limited Power
Message-ID: <TUE.13.APR.2010.171637.0700.FIELDTRIP@NIC.SURFNET.NL>

Hello everyone,



Does anyone have advice for examining - across trial time - power
modulations in very slow frequency ranges?



I am interested in isolating the slow (~0.1Hz) oscillatory activity of BOLD
signal and have been experimenting with different methods.  The data are
acquired at 30Hz using NIRS and I'd like to take advantage of our high
temporal resolution to dissociate the signal of interest from vascular and
other physiological artifacts in the frequency domain.  My main limitation
is that the data are acquired during relatively short trials of 57s length,
so I have encountered difficulties in trying to extract power modulation in
the 0.05Hz-0.15Hz range.  So far, I have tried wavelet decomposition and
bandpass filtering as different approaches but each introduces its own
artifacts.  I have not yet tried multi-taper methods since I am not as
familiar with those.  Any advice would be much appreciated!



Thanks,

Allen



____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA




----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100413/c5f76534/attachment.htm>

From ingrid.nieuwenhuis at FCDONDERS.RU.NL  Wed Apr 14 09:14:18 2010
From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis)
Date: Wed, 14 Apr 2010 09:14:18 +0200
Subject: Reference to non-existent field 'component'
In-Reply-To: <n2hc9bfa2fe1004131316t83501f4bz866b45556f17b66b@mail.gmail.com>
Message-ID: <WED.14.APR.2010.091418.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Bobby,



Are you using the latest version of FieldTrip? From the top of my head, I
think this relates to a bug that is solved in later versions.



Best,

Ingrid



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

Ingrid L.C. Nieuwenhuis

PhD student

Donders Institute for Brain, Cognition and Behaviour,

Centre for Cognitive Neuroimaging

Radboud University Nijmegen, The Netherlands

Email: ingrid.nieuwenhuis at donders.ru.nl

Tel: 0031 (0)24 - 36 10887

  _____

From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Bobby Stojanoski
Sent: Tuesday, April 13, 2010 10:16 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: [FIELDTRIP] Reference to non-existent field 'component'



Hello Everyone,



Thank you to everyone who responded to my earlier questions, the ensuing
conversation was extremely helpful!



I was hoping to get some help sorting out the following issue. I am trying
to plot significant clusters using ft_clusterplot, however with each attempt
I get this error message:

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



Error in ==> ft_topoplotER at 449

elseif ~isempty(cfg.component),



Error in ==> topoplotER at 17

[varargout{1:nargout}] = funhandle(varargin{:});



Error in ==> ft_clusterplot at 287

          topoplotER(cfgtopo, stat);



Error in ==> clusterplot at 17

[varargout{1:nargout}] = funhandle(varargin{:});



Error in ==> freqStatistics at 162

clusterplot(cfg, stat_PF_Val_D_InVal_D);



I tried setting cfg.component = [] or to some value, before running
freqgrandaverage, before running ft_freqstatistics and before plotting using
clusterplot, each time I get the same error. What is the source of this
error, and how can I move on?. Any help is greatly appreciated!



Many thanks,

Bobby



--
Bobby Stojanoski
Ph.D. Candidate
CoNSens lab
Department of Psychology
University of Toronto Scarborough
stojanoski at utsc.utoronto.ca
www.utsc.utoronto.ca/~stojanoski

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100414/6c5cbb47/attachment.htm>

From a.wollbrink at UNI-MUENSTER.DE  Wed Apr 14 10:21:10 2010
From: a.wollbrink at UNI-MUENSTER.DE (Andreas Wollbrink)
Date: Wed, 14 Apr 2010 10:21:10 +0200
Subject: problems making a template grid
Message-ID: <WED.14.APR.2010.102110.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi all,

I encountered some problems generating a template source grid as
described in the fieldtrip example matlab script 'Create MNI-aligned
grids in individual head-space':

1. in chapter 'Make the template_grid': Without defining a template
image in the cfg structure prior to use ft_volumesegment the default
setting cfg.template = '/home/common/matlab/spm2/templates/T1.mnc' is
used. Since this file might not exist in this specific folder on a
personal computer the function fails.
After defining cfg.template I succeed in using the function.
It might be helpful for others to add this comment to the example script.

2. My question at this point is: Should one use the individual template
'single_subj_T1.mnc' or the average template 'T1.mnc' to segment the
template brain and construct a volume conduction model?

3. Furtheron the function 'prepare_dipole_grid' could not be found. This
functions is placed in the private folder under fieldtrip. How can I
automatically add this folder to my matlab path?

Thanks,
Andreas

--


======================================================================

   Andreas Wollbrink, Biomedical Engineer

   Institute for Biomagnetism and Biosignalanalysis       	
   Muenster University Hospital

   Malmedyweg 15        phone:   +49-(0)251-83-52546
   D-48149 Muenster     fax:     +49-(0)251-83-56874	
   Germany
                        e-Mail: a.wollbrink at uni-muenster.de

======================================================================

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From a.stolk at FCDONDERS.RU.NL  Wed Apr 14 10:36:08 2010
From: a.stolk at FCDONDERS.RU.NL (a.stolk@fcdonders.ru.nl)
Date: Wed, 14 Apr 2010 10:36:08 +0200
Subject: problems making a template grid
In-Reply-To: <4BC57AF6.8050204@uni-muenster.de>
Message-ID: <WED.14.APR.2010.103608.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Andreas,

With recpect to your third question:

http://fieldtrip.fcdonders.nl/faq/matlab_does_not_see_the_functions_in_the_private_directory

Regards,
Arjen

----- Original Message -----
From: "Andreas Wollbrink" <a.wollbrink at UNI-MUENSTER.DE>
To: FIELDTRIP at NIC.SURFNET.NL
Sent: Wednesday, April 14, 2010 10:21:10 AM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: [FIELDTRIP] problems making a template grid

Hi all,

I encountered some problems generating a template source grid as
described in the fieldtrip example matlab script 'Create MNI-aligned
grids in individual head-space':

1. in chapter 'Make the template_grid': Without defining a template
image in the cfg structure prior to use ft_volumesegment the default
setting cfg.template = '/home/common/matlab/spm2/templates/T1.mnc' is
used. Since this file might not exist in this specific folder on a
personal computer the function fails.
After defining cfg.template I succeed in using the function.
It might be helpful for others to add this comment to the example script.

2. My question at this point is: Should one use the individual template
'single_subj_T1.mnc' or the average template 'T1.mnc' to segment the
template brain and construct a volume conduction model?

3. Furtheron the function 'prepare_dipole_grid' could not be found. This
functions is placed in the private folder under fieldtrip. How can I
automatically add this folder to my matlab path?

Thanks,
Andreas

--


======================================================================

   Andreas Wollbrink, Biomedical Engineer

   Institute for Biomagnetism and Biosignalanalysis       	
   Muenster University Hospital

   Malmedyweg 15        phone:   +49-(0)251-83-52546
   D-48149 Muenster     fax:     +49-(0)251-83-56874	
   Germany
                        e-Mail: a.wollbrink at uni-muenster.de

======================================================================

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From egarza at GMAIL.COM  Wed Apr 14 18:58:06 2010
From: egarza at GMAIL.COM (Eduardo Garza)
Date: Wed, 14 Apr 2010 18:58:06 +0200
Subject: Spike 2 to FT
Message-ID: <WED.14.APR.2010.185806.0200.FIELDTRIP@NIC.SURFNET.NL>

Greetings,

I'm not a programmer, and a beginner using Matlab, and I need to analyze 
Electrophysiological data from Deep Brain Stimulation using FT.
I have tried to get the data from one subject into FT but it tells me all the time 
that the Header is wrong.
The data was recorded using Spike2 from CED, and the data format I was given 
is ".txt", not ".smr" as it usually comes.

Basically the data looks something like this (although the format shown here is 
wrong, but I attached it to this email):

"Time"	"31 Key"	"16 R23"	"15 R23"	"14 R23"	"13 R23"	"10 01" 
"9 L23"	"8 L12"	"7 L01"	"6 RM1"	"5 LM1"	"4 R Flex"	"3 L 
Flex"	"2 R ext"	"1 L ext"
0.0000	0.000000	-153	-369	-29	0	4999.85	6.29	698.27	-
204.37	-11.028	2.547	11.62	-5.65	-12.27	21.09
0.0004	0.000000	131	-18	-125	140	4999.85	7.80	701.35	-
188.51	-11.769	4.792	9.17	-4.19	-12.31	19.84
0.0008	0.000000	305	-70	-279	-131	4999.85	7.93	708.54	-
174.54	-11.771	5.302	4.53	-4.36	-11.15	20.12
0.0012	0.000000	208	-153	-562	134	4999.85	7.79	721.20	-
165.24	-11.358	1.503	2.92	-6.49	-10.25	19.54
0.0016	0.000000	53	-153	-481	298	4999.85	6.84	739.02	-
153.11	-8.839	-2.125	2.88	-5.79	-10.44	18.59
0.0020	0.000000	0	-153	-327	452	4999.85	6.62	761.51	-
134.84	-8.992	-0.007	1.68	-4.09	-9.92	16.75

Basically 16 columns, the first one for time, others for voltage of 3 channels.

Is there a way to fix the header or create one so I can work with it in FT?
Or maybe a file converter?

Thanks in advance

Best regards

Eduardo

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
"Time"	"31 Key"	"16 R23"	"15 R23"	"14 R23"	"13 R23"	"10 01" "9 L23"	"8 L12"	"7 L01"	"6 RM1"	"5 LM1"	"4 R Flex"	"3 L Flex"	"2 R ext"	"1 L ext"
0.0000	0.000000	-153	-369	-29	0	4999.85	6.29	698.27	-204.37	-11.028	2.547	11.62	-5.65	-12.27	21.09
0.0004	0.000000	131	-18	-125	140	4999.85	7.80	701.35	-188.51	-11.769	4.792	9.17	-4.19	-12.31	19.84
0.0008	0.000000	305	-70	-279	-131	4999.85	7.93	708.54	-174.54	-11.771	5.302	4.53	-4.36	-11.15	20.12
0.0012	0.000000	208	-153	-562	134	4999.85	7.79	721.20	-165.24	-11.358	1.503	2.92	-6.49	-10.25	19.54
0.0016	0.000000	53	-153	-481	298	4999.85	6.84	739.02	-153.11	-8.839	-2.125	2.88	-5.79	-10.44	18.59
0.0020	0.000000	0	-153	-327	452	4999.85	6.62	761.51	-134.84	-8.992	-0.007	1.68	-4.09	-9.92	16.75


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

From daz at MIT.EDU  Wed Apr 14 21:19:32 2010
From: daz at MIT.EDU (David Ziegler)
Date: Wed, 14 Apr 2010 21:19:32 +0200
Subject: forming one datset from multiple data files
Message-ID: <WED.14.APR.2010.211932.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Fieldtrippers,

I have a similar situation where I have 3 "runs" of trials that were
collected separately on a neuromag306 system.  I took Ingrid's advice and
ran ft_appenddata on my preprocessed (e.g., trigger-based trial selection,
artifact rejection, and preprocessing) data files to combine the three
datasets into a single file.  The function worked, but with the warning that
the sensor info was not consistent across trials:

>> cfg=[];
>> allT4 = ft_appenddata(cfg, dataT4_list11, dataT4_list8, dataT4_list9);
input dataset 1, 308 channels, 32 trials
input dataset 2, 308 channels, 32 trials
input dataset 3, 308 channels, 32 trials
Warning: sensor information does not seem to be consistent across the input
arguments 
> In ft_appenddata at 106
concatenating the trials over all datasets
removing sensor information from output
output dataset, 308 channels, 96 trials

Is there a better way to concatenate several runs of similar trials such
that the sensor information is preserved?  I can generate an time-locked
average on the resulting concatenated data, but I am not able to plot it
using multiplot or topoplot, just by viewing individual single channels
(presumably due to the stripping of the sensory info).

Thanks for any advice!
David

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From dahliash at STANFORD.EDU  Thu Apr 15 00:42:39 2010
From: dahliash at STANFORD.EDU (Dahlia Sharon)
Date: Thu, 15 Apr 2010 00:42:39 +0200
Subject: importing vol and grid for beamforming (ft_sourceanalysis)
Message-ID: <THU.15.APR.2010.004239.0200.FIELDTRIP@NIC.SURFNET.NL>

Thanks Robert. In the case of a non-spherical, 3 layer BEM volume, what
should the fields of "vol" be? 
Also, I have a source space that I would like to use (corresponding to the
cortical surface) instead of the grid - how can this be done?
Thanks again!
Dahlia.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From jan.schoffelen at DONDERS.RU.NL  Thu Apr 15 08:52:22 2010
From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen)
Date: Thu, 15 Apr 2010 08:52:22 +0200
Subject: forming one datset from multiple data files
In-Reply-To: <LISTSERV%201004142119321980.D987@NIC.SURFNET.NL>
Message-ID: <THU.15.APR.2010.085222.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear David,

The reason why the sensor info is explicitly removed by ft_appenddata
is to ensure that people realize that combining multiple sessions may
be problematic or even downright 'forbidden' for some subsequent steps
in the analysis. Think of e.g. doing source analysis for a single
subject in which several sessions are combined. Since the subject's
position was slightly different during each recording sessions, there
is in fact not a guarantee that during one of the sessions the subject
would have sat facing backwards ;o). The leadfields computed in such a
case (appending with in one of the sessions the subject facing
backwards) will clearly be wrong for most of the data. Of course if
you were able to somehow compensate for the differences in position,
e.g. by applying the maxfilter, things may be different.
Yet, indeed for visualizing the results, and if you are confident that
there were no gross differences across the sessions with respect to
the positioning of the subject, there is no objection against keeping
the gradiometer info. Although I am a bit puzzled by the fact that you
do not seem to be able to visualize the data as you have it (because I
thought that provided you give the plotting function an appropriate
layout-file, in your case something like NM306xxx.lay, I would assume
that it just works even without sensor position info; for the layout
files, have a look in fieldtrip/templates, or at the wiki), you could
of course 'fool' fieldtrip by appending a grad-structure to your
concatenated data: allT4.grad = dataT4_list1.grad;

Hope this helps,
Jan-Mathijs


On Apr 14, 2010, at 9:19 PM, David Ziegler wrote:

> Hi Fieldtrippers,
>
> I have a similar situation where I have 3 "runs" of trials that were
> collected separately on a neuromag306 system.  I took Ingrid's
> advice and
> ran ft_appenddata on my preprocessed (e.g., trigger-based trial
> selection,
> artifact rejection, and preprocessing) data files to combine the three
> datasets into a single file.  The function worked, but with the
> warning that
> the sensor info was not consistent across trials:
>
>>> cfg=[];
>>> allT4 = ft_appenddata(cfg, dataT4_list11, dataT4_list8,
>>> dataT4_list9);
> input dataset 1, 308 channels, 32 trials
> input dataset 2, 308 channels, 32 trials
> input dataset 3, 308 channels, 32 trials
> Warning: sensor information does not seem to be consistent across
> the input
> arguments
>> In ft_appenddata at 106
> concatenating the trials over all datasets
> removing sensor information from output
> output dataset, 308 channels, 96 trials
>
> Is there a better way to concatenate several runs of similar trials
> such
> that the sensor information is preserved?  I can generate an time-
> locked
> average on the resulting concatenated data, but I am not able to
> plot it
> using multiplot or topoplot, just by viewing individual single
> channels
> (presumably due to the stripping of the sensory info).
>
> Thanks for any advice!
> David
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip  toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html
>  and http://www.ru.nl/neuroimaging/fieldtrip.
>

Dr. J.M. (Jan-Mathijs) Schoffelen
Donders Institute for Brain, Cognition and Behaviour,
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands
J.Schoffelen at donders.ru.nl
Telephone: 0031-24-3668063

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From masaki.maruyama at CEA.FR  Thu Apr 15 10:39:26 2010
From: masaki.maruyama at CEA.FR (MARUYAMA Masaki INSERM)
Date: Thu, 15 Apr 2010 10:39:26 +0200
Subject: ft_sourceinterpolate needs ft_convert_units?
Message-ID: <THU.15.APR.2010.103926.0200.FIELDTRIP@NIC.SURFNET.NL>

Hello,

 

 

>>From the last version of fieldtrip, ft_sourceinterpolate does not work
since it cannot find ft_convert_units. I think ft_convert_units is a new
function, and it has not implemented yet in Fieldtrip. Could you please
check this issue?  I attached an error message when I run
ft_sourceinterpolate.

 

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

the input is source data with 90364 positions

??? Undefined function or method 'ft_convert_units' for input arguments
of type 'struct'.

Error in ==> checkdata at 340

    data = ft_convert_units(data);

Error in ==> ft_sourceinterpolate at 60

functional = checkdata(functional, 'datatype', 'volume', 'inside',
'logical', 'feedback', 'yes', 'hasunits', 'yes');

Error in ==> Neurospin_SourceLevelAnalysis_V4 at 442

            source_int =
ft_sourceinterpolate(cfg,source_ind_temp,mri_ctf);

 

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

 

 

By the way, I have corrected the unit of positions manually (cm-->mm),
such as "source_ind_temp.pos = source_ind_temp.pos*10" before the
interpolation. I'm afraid that my method may become incorrect after the
new version, since the new function seems to scale the unit
automatically. I would appreciate if you could give me an advice.

 

 

With best regards,

Masaki Maruyama 

 


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100415/27378126/attachment.htm>

From stavros.zanos at YAHOO.COM  Thu Apr 15 14:17:21 2010
From: stavros.zanos at YAHOO.COM (Stavros Zanos)
Date: Thu, 15 Apr 2010 05:17:21 -0700
Subject: EKG/pulse wave artifact on EMG signals
Message-ID: <THU.15.APR.2010.051721.0700.FIELDTRIP@NIC.SURFNET.NL>

Hi all-

In analyzing some (intramuscular) EMG signals I have
acquired, I noticed quite pronounced EKG/pulse wave artifacts. Each
muscle has been implanted with 3 wires, and therefore there are up to 3
EMG signals per muscle. However, bipolar EMG derivations do not always
get rid of the artifacts, as different EMG wires are implanted in
different parts of the muscle, and some of them happen to be closer to
arteries than others.

The amplitude of the pulse wave artifact is comparable to low-level EMG activity; its duration is ~300msec.
Conventional smoothing/filtering does not solve the problem.
Identifying the timing of, and removing, these artifacts in the absense
of EMG activity is easy; it gets tricky during EMG activity though, when the artifact gets buried inside the EMG signal.

Is there any (automated) way of removing these
artifacts?  I've thought of performing PCA on all single-ended EMG
signals, making sure one of the first few PCs captures the artifact, and then removing the back-projection of that PC from the original EMGs.
This method has worked for me in the past with removing artifacts from
EEG signals.  The potential problem I foresee with that approach with
EMGs is that it relies on simultaneous recording of the artifact on many channels.  In the case of EMGs however, the timing of the pulse
artifact is slightly different for different EMGs/muscles; for example,
an EMG signal from a proximal muscle will capture the pulse wave earlier than an EMG signal from a distal muscle.

Many thanks in advance
for any insight.

Stavros Zanos, M.D.
University of Washington
School of Medicine
I-413B, WaNPRC
206-6168729
zanos at u.washington.edu

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100415/5c1b3c11/attachment.htm>

From daz at MIT.EDU  Thu Apr 15 16:14:33 2010
From: daz at MIT.EDU (David Ziegler)
Date: Thu, 15 Apr 2010 10:14:33 -0400
Subject: forming one datset from multiple data files
In-Reply-To: <C1E31124-9973-4F3A-B2E3-712AE124E6E2@donders.ru.nl>
Message-ID: <THU.15.APR.2010.101433.0400.FIELDTRIP@NIC.SURFNET.NL>

Hi Jan-Mathijs,

Thanks for the detailed response!  I am very much aware of the dangers
of concatenating data over sessions and assuming the sensor space is the
same.  In my case, the "runs" were all acquired during a single session
(i.e., 6 runs, 7 min each, in a single 50 min session) in which head
position was pretty carefully monitored.

Your trick of manually defining allT4.grad to be the same as the
original data file works just fine.  I did originally try simply
specifying cfg.layout = NM306mag.lay (as well as other NM306***.lay
options), and these resulted in plots, but they were simply empty square
line grids with four boxes.  Not sure why this was the case, but as long
as your fix works, I am all set for the moment.

Thanks!
David

jan-mathijs schoffelen wrote:
> Dear David,
>
> The reason why the sensor info is explicitly removed by ft_appenddata
> is to ensure that people realize that combining multiple sessions may
> be problematic or even downright 'forbidden' for some subsequent steps
> in the analysis. Think of e.g. doing source analysis for a single
> subject in which several sessions are combined. Since the subject's
> position was slightly different during each recording sessions, there
> is in fact not a guarantee that during one of the sessions the subject
> would have sat facing backwards ;o). The leadfields computed in such a
> case (appending with in one of the sessions the subject facing
> backwards) will clearly be wrong for most of the data. Of course if
> you were able to somehow compensate for the differences in position,
> e.g. by applying the maxfilter, things may be different.
> Yet, indeed for visualizing the results, and if you are confident that
> there were no gross differences across the sessions with respect to
> the positioning of the subject, there is no objection against keeping
> the gradiometer info. Although I am a bit puzzled by the fact that you
> do not seem to be able to visualize the data as you have it (because I
> thought that provided you give the plotting function an appropriate
> layout-file, in your case something like NM306xxx.lay, I would assume
> that it just works even without sensor position info; for the layout
> files, have a look in fieldtrip/templates, or at the wiki), you could
> of course 'fool' fieldtrip by appending a grad-structure to your
> concatenated data: allT4.grad = dataT4_list1.grad;
>
> Hope this helps,
> Jan-Mathijs
>
>
> On Apr 14, 2010, at 9:19 PM, David Ziegler wrote:
>
>> Hi Fieldtrippers,
>>
>> I have a similar situation where I have 3 "runs" of trials that were
>> collected separately on a neuromag306 system.  I took Ingrid's advice
>> and
>> ran ft_appenddata on my preprocessed (e.g., trigger-based trial
>> selection,
>> artifact rejection, and preprocessing) data files to combine the three
>> datasets into a single file.  The function worked, but with the
>> warning that
>> the sensor info was not consistent across trials:
>>
>>>> cfg=[];
>>>> allT4 = ft_appenddata(cfg, dataT4_list11, dataT4_list8, dataT4_list9);
>> input dataset 1, 308 channels, 32 trials
>> input dataset 2, 308 channels, 32 trials
>> input dataset 3, 308 channels, 32 trials
>> Warning: sensor information does not seem to be consistent across the
>> input
>> arguments
>>> In ft_appenddata at 106
>> concatenating the trials over all datasets
>> removing sensor information from output
>> output dataset, 308 channels, 96 trials
>>
>> Is there a better way to concatenate several runs of similar trials such
>> that the sensor information is preserved?  I can generate an time-locked
>> average on the resulting concatenated data, but I am not able to plot it
>> using multiplot or topoplot, just by viewing individual single channels
>> (presumably due to the stripping of the sensory info).
>>
>> Thanks for any advice!
>> David
>>
>> ----------------------------------
>> The aim of this list is to facilitate the discussion between users of
>> the FieldTrip  toolbox, to share experiences and to discuss new ideas
>> for MEG and EEG analysis. See also
>> http://listserv.surfnet.nl/archives/fieldtrip.html and
>> http://www.ru.nl/neuroimaging/fieldtrip.
>>
>
> Dr. J.M. (Jan-Mathijs) Schoffelen
> Donders Institute for Brain, Cognition and Behaviour,
> Centre for Cognitive Neuroimaging,
> Radboud University Nijmegen, The Netherlands
> J.Schoffelen at donders.ru.nl
> Telephone: 0031-24-3668063
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of
> the FieldTrip  toolbox, to share experiences and to discuss new ideas
> for MEG and EEG analysis. See also
> http://listserv.surfnet.nl/archives/fieldtrip.html and
> http://www.ru.nl/neuroimaging/fieldtrip.

--

David A. Ziegler

Department of Brain and Cognitive Sciences
Massachusetts Institute of Technology
43 Vassar St,  46-5121
Cambridge, MA  02139

Tel: 617-258-0765

Fax: 617-253-1504

daz at mit.edu <mailto:daz at mit.edu>






----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100415/3ba66d53/attachment.htm>

From a.wollbrink at UNI-MUENSTER.DE  Thu Apr 15 18:05:04 2010
From: a.wollbrink at UNI-MUENSTER.DE (Andreas Wollbrink)
Date: Thu, 15 Apr 2010 18:05:04 +0200
Subject: problems making a template grid
In-Reply-To: <22893932.1469641271234168787.JavaMail.root@watertor.uci.ru.nl>
Message-ID: <THU.15.APR.2010.180504.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Arjen,

thank you for your help.

Regards,
Andreas

On 04/14/10 10:36, a.stolk at fcdonders.ru.nl wrote:
> Hi Andreas,
>
> With recpect to your third question:
>
> http://fieldtrip.fcdonders.nl/faq/matlab_does_not_see_the_functions_in_the_private_directory
>
> Regards,
> Arjen
>
> ----- Original Message -----
> From: "Andreas Wollbrink"<a.wollbrink at UNI-MUENSTER.DE>
> To: FIELDTRIP at NIC.SURFNET.NL
> Sent: Wednesday, April 14, 2010 10:21:10 AM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
> Subject: [FIELDTRIP] problems making a template grid
>
> Hi all,
>
> I encountered some problems generating a template source grid as
> described in the fieldtrip example matlab script 'Create MNI-aligned
> grids in individual head-space':
>
> 1. in chapter 'Make the template_grid': Without defining a template
> image in the cfg structure prior to use ft_volumesegment the default
> setting cfg.template = '/home/common/matlab/spm2/templates/T1.mnc' is
> used. Since this file might not exist in this specific folder on a
> personal computer the function fails.
> After defining cfg.template I succeed in using the function.
> It might be helpful for others to add this comment to the example script.
>
> 2. My question at this point is: Should one use the individual template
> 'single_subj_T1.mnc' or the average template 'T1.mnc' to segment the
> template brain and construct a volume conduction model?
>
> 3. Furtheron the function 'prepare_dipole_grid' could not be found. This
> functions is placed in the private folder under fieldtrip. How can I
> automatically add this folder to my matlab path?
>
> Thanks,
> Andreas
>

--


======================================================================

   Andreas Wollbrink, Biomedical Engineer

   Institute for Biomagnetism and Biosignalanalysis       	
   Muenster University Hospital

   Malmedyweg 15        phone:   +49-(0)251-83-52546
   D-48149 Muenster     fax:     +49-(0)251-83-56874	
   Germany
                        e-Mail: a.wollbrink at uni-muenster.de

======================================================================

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From g.piantoni at NIN.KNAW.NL  Fri Apr 16 10:13:30 2010
From: g.piantoni at NIN.KNAW.NL (Giovanni Piantoni)
Date: Fri, 16 Apr 2010 10:13:30 +0200
Subject: ft_sourceinterpolate needs ft_convert_units?
In-Reply-To: <F654B3EE96986E4B8DC6EF0919C88DA3054E2A@LODERI.intra.cea.fr>
Message-ID: <FRI.16.APR.2010.101330.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Masaki,

ft_convert_units is not a new function but has recently been moved
from convert_units.m to ft_convert_units.m
Now, it appears that it got lost in the renaming process. If you check
it was there if you download fieldtrip-20100413 (in the 'forward'
folder) but not in fieldtrip-20100415.
For the moment you can use the fieldtrip-20100413 version. Hopefully
soon, the new fieldtrip version will include ft_convert_units.m again.

Actually these are the missing functions:
XXX at XXX:~/Downloads$ diff fieldtrip-20100413/forward/
fieldtrip-20100415/forward/
Common subdirectories: fieldtrip-20100413/forward/compat and
fieldtrip-20100415/forward/compat
Only in fieldtrip-20100413/forward/: ft_apply_montage.m
Only in fieldtrip-20100413/forward/: ft_convert_units.m
Only in fieldtrip-20100413/forward/: ft_estimate_units.m
Common subdirectories: fieldtrip-20100413/forward/private and
fieldtrip-20100415/forward/private

HTH,
Gio

On Thu, Apr 15, 2010 at 10:39, MARUYAMA Masaki INSERM
<masaki.maruyama at cea.fr> wrote:
> Hello,
>
>
>
>
>
> From the last version of fieldtrip, ft_sourceinterpolate does not work since
> it cannot find ft_convert_units. I think ft_convert_units is a new function,
> and it has not implemented yet in Fieldtrip. Could you please check this
> issue?  I attached an error message when I run ft_sourceinterpolate.
>
>
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> the input is source data with 90364 positions
>
> ??? Undefined function or method 'ft_convert_units' for input arguments of
> type 'struct'.
>
> Error in ==> checkdata at 340
>
>     data = ft_convert_units(data);
>
> Error in ==> ft_sourceinterpolate at 60
>
> functional = checkdata(functional, 'datatype', 'volume', 'inside',
> 'logical', 'feedback', 'yes', 'hasunits', 'yes');
>
> Error in ==> Neurospin_SourceLevelAnalysis_V4 at 442
>
>             source_int = ft_sourceinterpolate(cfg,source_ind_temp,mri_ctf);
>
>
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
>
>
>
>
> By the way, I have corrected the unit of positions manually (cmàmm), such as
> "source_ind_temp.pos = source_ind_temp.pos*10" before the interpolation. I'm
> afraid that my method may become incorrect after the new version, since the
> new function seems to scale the unit automatically. I would appreciate if
> you could give me an advice.
>
>
>
>
>
> With best regards,
>
> Masaki Maruyama
>
>
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
> EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/



-- 
Giovanni Piantoni, Ph.D. student
Dept. Sleep & Cognition
Netherlands Institute for Neuroscience
Meibergdreef 47
1105 BA Amsterdam (NL)

+31 (0)20 5665492
g.piantoni at nin.knaw.nl
www.nin.knaw.nl/research_groups/van_someren_group/

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From r.oostenveld at FCDONDERS.RU.NL  Fri Apr 16 10:11:44 2010
From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld)
Date: Fri, 16 Apr 2010 10:11:44 +0200
Subject: ft_sourceinterpolate needs ft_convert_units?
In-Reply-To: <F654B3EE96986E4B8DC6EF0919C88DA3054E2A@LODERI.intra.cea.fr>
Message-ID: <FRI.16.APR.2010.101144.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Masaki

Sorry for the ft_convert_units and ft_estimate units functions missing
in the last few releases of fieldtrip. That is due to a bug in our SVN
version control system. I will fix it. In the mean time, please find
the tro functions attached. They should go into the fieldtrip/forward
directory.

best regards,
Robert


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_estimate_units.m
Type: application/octet-stream
Size: 811 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/f5afeb81/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_convert_units.m
Type: application/octet-stream
Size: 5430 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/f5afeb81/attachment-0001.obj>
-------------- next part --------------



On 15 Apr 2010, at 10:39, MARUYAMA Masaki INSERM wrote:

> Hello,
>
>
> From the last version of fieldtrip, ft_sourceinterpolate does not  
> work since it cannot find ft_convert_units. I think ft_convert_units  
> is a new function, and it has not implemented yet in Fieldtrip.  
> Could you please check this issue?  I attached an error message when  
> I run ft_sourceinterpolate.
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> the input is source data with 90364 positions
> ??? Undefined function or method 'ft_convert_units' for input  
> arguments of type 'struct'.
> Error in ==> checkdata at 340
>     data = ft_convert_units(data);
> Error in ==> ft_sourceinterpolate at 60
> functional = checkdata(functional, 'datatype', 'volume', 'inside',  
> 'logical', 'feedback', 'yes', 'hasunits', 'yes');
> Error in ==> Neurospin_SourceLevelAnalysis_V4 at 442
>             source_int =  
> ft_sourceinterpolate(cfg,source_ind_temp,mri_ctf);
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
>
> By the way, I have corrected the unit of positions manually (cmàmm),  
> such as "source_ind_temp.pos = source_ind_temp.pos*10" before the  
> interpolation. I'm afraid that my method may become incorrect after  
> the new version, since the new function seems to scale the unit  
> automatically. I would appreciate if you could give me an advice.
>
>
> With best regards,
> Masaki Maruyama
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users  
> of the FieldTrip toolbox, to share experiences and to discuss new  
> ideas for MEG and EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/
>


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

From masaki.maruyama at CEA.FR  Fri Apr 16 10:52:36 2010
From: masaki.maruyama at CEA.FR (MARUYAMA Masaki INSERM)
Date: Fri, 16 Apr 2010 10:52:36 +0200
Subject: ft_sourceinterpolate needs ft_convert_units?
In-Reply-To: A<16EC3BD1-5A06-4F5D-B94A-56F8DF398B84@fcdonders.ru.nl>
Message-ID: <FRI.16.APR.2010.105236.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Gio and Robert,

I really appreciate your prompt answer and giving me the helpful solution!

Masaki


>-----Message d'origine-----
>De : FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] De la part
>de Robert Oostenveld
>Envoyé : vendredi 16 avril 2010 10:12
>À : FIELDTRIP at NIC.SURFNET.NL
>Objet : Re: [FIELDTRIP] ft_sourceinterpolate needs ft_convert_units?
>
>Dear Masaki
>
>Sorry for the ft_convert_units and ft_estimate units functions missing
>in the last few releases of fieldtrip. That is due to a bug in our SVN
>version control system. I will fix it. In the mean time, please find
>the tro functions attached. They should go into the fieldtrip/forward
>directory.
>
>best regards,
>Robert
>
>
>----------------------------------
>The aim of this list is to facilitate the discussion between users of the
>FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
>and EEG analysis. See also
>http://listserv.surfnet.nl/archives/fieldtrip.html and
>http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From grion at SISSA.IT  Fri Apr 16 13:09:28 2010
From: grion at SISSA.IT (Natalia Grion)
Date: Fri, 16 Apr 2010 13:09:28 +0200
Subject: redefinetrial_offset option
Message-ID: <FRI.16.APR.2010.130928.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi all,
         When inspecting in detail "redefinetrial" function I found a
striking point, I think there is an error on the code that could
be easily solved but maybe i'm missing something:
 My trials are of fixed length: they go from -3sec to +3sec with 1 trigger
event as t=0. I want to realign the trials to a new (sub)event, so I
defined offset as: Nxsamples relative to t=0. For each trial, offset has
different signs as the event happened either before trigger event
(-#samples) or after it (+#samples).
In the code: when having for example -51 (samples relative to trigger)
data.time is shifted to the left, and this would be correct. But when
correcting "trial definition" this offset is summed to trl(:,3); the point
is: my trl(:,3) is negative since is indicating  that the trial begins
before the trigger, (-)6009 +(-51) results in shifting the offset of
trigger to the right which is not the case: (possible solution:
abs(trl(:,3))+(-51).). Then: trl(:,1),trl(:,2) correction is omitted, why?
as "event" changed, shouldn't beg and ensample follow this change?
sticking to +/-3sec defined as star/end of trial? In fact, data.time was
shift. In the rest of the code i don't see any line related to this
change.
 Any help will be welcome!
Natalia

.............................
elseif ~isempty(cfg.offset)
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% shift the time axis from each trial
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
offset = cfg.offset(:);
  if length(cfg.offset)==1
    offset = repmat(offset, Ntrial, 1);
  end
  for i=1:Ntrial
    data.time{i} = data.time{i} + offset(i)/data.fsample;
  end

  % also correct the trial definition
  if ~isempty(trl)
    trl(:,3) = trl(:,3) + offset;
  end
........................................

----------------------------------------------------------------
  SISSA Webmail https://webmail.sissa.it/
  Powered by SquirrelMail http://www.squirrelmail.org/





----------------------------------------------------------------
  SISSA Webmail https://webmail.sissa.it/
  Powered by SquirrelMail http://www.squirrelmail.org/

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From michael.wibral at WEB.DE  Fri Apr 16 13:27:46 2010
From: michael.wibral at WEB.DE (Michael Wibral)
Date: Fri, 16 Apr 2010 13:27:46 +0200
Subject: redefinetrial_offset option
In-Reply-To: <2988.147.122.60.164.1271416168.squirrel@webmail.sissa.it>
Message-ID: <FRI.16.APR.2010.132746.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Natalie,

may be I am missing something but the shift by 51 samples implied by

(-)6009 +(-51)

is always to the "left" as you call it - irrespective of the sign of "6009":

6009 +(-51) = 5958 < 6009 (left shift)

-6009 +(-51) = -6060 < -6009 (left shift)


Michael

-----Ursprüngliche Nachricht-----
Von: Natalia Grion <grion at SISSA.IT>
Gesendet: Apr 16, 2010 1:09:28 PM
An: FIELDTRIP at NIC.SURFNET.NL
Betreff: [FIELDTRIP] redefinetrial_offset option

>Hi all,
>         When inspecting in detail "redefinetrial" function I found a
>striking point, I think there is an error on the code that could
>be easily solved but maybe i'm missing something:
> My trials are of fixed length: they go from -3sec to +3sec with 1 trigger
>event as t=0. I want to realign the trials to a new (sub)event, so I
>defined offset as: Nxsamples relative to t=0. For each trial, offset has
>different signs as the event happened either before trigger event
>(-#samples) or after it (+#samples).
>In the code: when having for example -51 (samples relative to trigger)
>data.time is shifted to the left, and this would be correct. But when
>correcting "trial definition" this offset is summed to trl(:,3); the point
>is: my trl(:,3) is negative since is indicating  that the trial begins
>before the trigger, (-)6009 +(-51) results in shifting the offset of
>trigger to the right which is not the case: (possible solution:
>abs(trl(:,3))+(-51).). Then: trl(:,1),trl(:,2) correction is omitted, why?
>as "event" changed, shouldn't beg and ensample follow this change?
>sticking to +/-3sec defined as star/end of trial? In fact, data.time was
>shift. In the rest of the code i don't see any line related to this
>change.
> Any help will be welcome!
>Natalia
>
>.............................
>elseif ~isempty(cfg.offset)
>  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>% shift the time axis from each trial
>  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>offset = cfg.offset(:);
>  if length(cfg.offset)==1
>    offset = repmat(offset, Ntrial, 1);
>  end
>  for i=1:Ntrial
>    data.time{i} = data.time{i} + offset(i)/data.fsample;
>  end
>
>  % also correct the trial definition
>  if ~isempty(trl)
>    trl(:,3) = trl(:,3) + offset;
>  end
>........................................
>
>----------------------------------------------------------------
>  SISSA Webmail https://webmail.sissa.it/
>  Powered by SquirrelMail http://www.squirrelmail.org/
>
>
>
>
>
>----------------------------------------------------------------
>  SISSA Webmail https://webmail.sissa.it/
>  Powered by SquirrelMail http://www.squirrelmail.org/
>
>----------------------------------
>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Michael Wibral.vcf
Type: text/x-vcard
Size: 628 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/5d585754/attachment.vcf>

From grion at SISSA.IT  Fri Apr 16 14:42:01 2010
From: grion at SISSA.IT (Natalia Grion)
Date: Fri, 16 Apr 2010 14:42:01 +0200
Subject: redefinetrial_offset option
Message-ID: <FRI.16.APR.2010.144201.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Michael,
When I wrote possible solution i meant: -(abs(trl(:,3))+(-51)) = -5958,
which is conceptually different from -6060.
In "definetrial" function when declaring trl(:,3)= - 6009 means that
1)trial start before trigger event (negative sign) and 2)the offset of
trigger is 6009 samples away with respect to the "begining" of the trial:
in sum: that the trial starts 6009 steps before trigger. If the sub-event
to which i want to realign happens 51 steps before trigger, then number of
steps with respect to t=0 are "-" 51, and this is applied when defining
data.time in the code of redefinetrial. But when redefining trl(:,3),
trigger  should get "closer" to beginning of trial, as beginning of trial
is still the old one. If what i' saying is correct, then also trl(:,1) and
(:,2) has to be modified relative to the new "sub-event".
Any reply will be great.
Natalia


> Hi Natalie,
>
> may be I am missing something but the shift by 51 samples implied by
>
> (-)6009 +(-51)
>
> is always to the "left" as you call it - irrespective of the sign of
"6009":
>
> 6009 +(-51) = 5958 < 6009 (left shift)
>
> -6009 +(-51) = -6060 < -6009 (left shift)
>
>
> Michael
>
> -----UrsprÃ¼ngliche Nachricht-----
> Von: Natalia Grion <grion at SISSA.IT>
> Gesendet: Apr 16, 2010 1:09:28 PM
> An: FIELDTRIP at NIC.SURFNET.NL
> Betreff: [FIELDTRIP] redefinetrial_offset option
>
>>Hi all,
>>         When inspecting in detail "redefinetrial" function I found a
>>striking point, I think there is an error on the code that could be
easily solved but maybe i'm missing something:
>> My trials are of fixed length: they go from -3sec to +3sec with 1 trigger
>>event as t=0. I want to realign the trials to a new (sub)event, so I
defined offset as: Nxsamples relative to t=0. For each trial, offset has
different signs as the event happened either before trigger event
(-#samples) or after it (+#samples).
>>In the code: when having for example -51 (samples relative to trigger)
data.time is shifted to the left, and this would be correct. But when
correcting "trial definition" this offset is summed to trl(:,3); the
>> point
>>is: my trl(:,3) is negative since is indicating  that the trial begins
before the trigger, (-)6009 +(-51) results in shifting the offset of
trigger to the right which is not the case: (possible solution:
>>abs(trl(:,3))+(-51).). Then: trl(:,1),trl(:,2) correction is omitted,
>> why?
>>as "event" changed, shouldn't beg and ensample follow this change?
sticking to +/-3sec defined as star/end of trial? In fact, data.time was
shift. In the rest of the code i don't see any line related to this
change.
>> Any help will be welcome!
>>Natalia
>>.............................
>>elseif ~isempty(cfg.offset)
>>  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>% shift the time axis from each trial
>>  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>offset = cfg.offset(:);
>>  if length(cfg.offset)==1
>>    offset = repmat(offset, Ntrial, 1);
>>  end
>>  for i=1:Ntrial
>>    data.time{i} = data.time{i} + offset(i)/data.fsample;
>>  end
>>  % also correct the trial definition
>>  if ~isempty(trl)
>>    trl(:,3) = trl(:,3) + offset;
>>  end
>>........................................
>>----------------------------------------------------------------
>>  SISSA Webmail https://webmail.sissa.it/
>>  Powered by SquirrelMail http://www.squirrelmail.org/
>>----------------------------------------------------------------
>>  SISSA Webmail https://webmail.sissa.it/
>>  Powered by SquirrelMail http://www.squirrelmail.org/
>>----------------------------------
>>The aim of this list is to facilitate the discussion between users of
the
>> FieldTrip  toolbox, to share experiences and to discuss new ideas for
MEG
>> and EEG analysis. See also
>> http://listserv.surfnet.nl/archives/fieldtrip.html and
>> http://www.ru.nl/neuroimaging/fieldtrip.
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of
the
> FieldTrip  toolbox, to share experiences and to discuss new ideas for
MEG
> and EEG analysis. See also
> http://listserv.surfnet.nl/archives/fieldtrip.html and
> http://www.ru.nl/neuroimaging/fieldtrip.


----------------------------------------------------------------
  SISSA Webmail https://webmail.sissa.it/
  Powered by SquirrelMail http://www.squirrelmail.org/





----------------------------------------------------------------
  SISSA Webmail https://webmail.sissa.it/
  Powered by SquirrelMail http://www.squirrelmail.org/

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From jan.schoffelen at DONDERS.RU.NL  Fri Apr 16 15:02:07 2010
From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen)
Date: Fri, 16 Apr 2010 15:02:07 +0200
Subject: redefinetrial_offset option
In-Reply-To: <3217.147.122.60.164.1271421721.squirrel@webmail.sissa.it>
Message-ID: <FRI.16.APR.2010.150207.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Natalia,

The 'offset'-column in a trl-matrix tells you how many points you have  
to move away from t=0, to get to the begin of the trial. In other  
words, for a given trial, if the offset value is negative, this means  
that you have to move X samples to the right to get to time point t=0.  
Consequently, the first value of the corresponding time-axis is  
negative. Important to keep in mind is that the third column of the  
trl-matrix defines the 'local time axis' of your epoch of interest,  
whereas the first two columns represent the begin and end sample of  
the epoch, fixed to the 'absolute recording time'. This means that if  
you only want to shift the local time axis, those first columns should  
not change.
Now, if you want to realign the time axes of your epochs of interest  
according to the vector you described (a negative value of -51 meaning  
that the sub-event occurred before the trigger event) this implies  
that the newly defined t=0 moves to the left, and that implies that  
you have to add 51 samples to the third element in the trl-row.

Hope this helps,

Jan-Mathijs

On Apr 16, 2010, at 2:42 PM, Natalia Grion wrote:

> Hi Michael,
> When I wrote possible solution i meant: -(abs(trl(:,3))+(-51)) =  
> -5958,
> which is conceptually different from -6060.
> In "definetrial" function when declaring trl(:,3)= - 6009 means that
> 1)trial start before trigger event (negative sign) and 2)the offset of
> trigger is 6009 samples away with respect to the "begining" of the  
> trial:
> in sum: that the trial starts 6009 steps before trigger. If the sub- 
> event
> to which i want to realign happens 51 steps before trigger, then  
> number of
> steps with respect to t=0 are "-" 51, and this is applied when  
> defining
> data.time in the code of redefinetrial. But when redefining trl(:,3),
> trigger  should get "closer" to beginning of trial, as beginning of  
> trial
> is still the old one. If what i' saying is correct, then also trl(:, 
> 1) and
> (:,2) has to be modified relative to the new "sub-event".
> Any reply will be great.
> Natalia
>
>
>> Hi Natalie,
>>
>> may be I am missing something but the shift by 51 samples implied by
>>
>> (-)6009 +(-51)
>>
>> is always to the "left" as you call it - irrespective of the sign of
> "6009":
>>
>> 6009 +(-51) = 5958 < 6009 (left shift)
>>
>> -6009 +(-51) = -6060 < -6009 (left shift)
>>
>>
>> Michael
>>
>> -----UrsprÃ¼ngliche Nachricht-----
>> Von: Natalia Grion <grion at SISSA.IT>
>> Gesendet: Apr 16, 2010 1:09:28 PM
>> An: FIELDTRIP at NIC.SURFNET.NL
>> Betreff: [FIELDTRIP] redefinetrial_offset option
>>
>>> Hi all,
>>>        When inspecting in detail "redefinetrial" function I found a
>>> striking point, I think there is an error on the code that could be
> easily solved but maybe i'm missing something:
>>> My trials are of fixed length: they go from -3sec to +3sec with 1  
>>> trigger
>>> event as t=0. I want to realign the trials to a new (sub)event, so I
> defined offset as: Nxsamples relative to t=0. For each trial, offset  
> has
> different signs as the event happened either before trigger event
> (-#samples) or after it (+#samples).
>>> In the code: when having for example -51 (samples relative to  
>>> trigger)
> data.time is shifted to the left, and this would be correct. But when
> correcting "trial definition" this offset is summed to trl(:,3); the
>>> point
>>> is: my trl(:,3) is negative since is indicating  that the trial  
>>> begins
> before the trigger, (-)6009 +(-51) results in shifting the offset of
> trigger to the right which is not the case: (possible solution:
>>> abs(trl(:,3))+(-51).). Then: trl(:,1),trl(:,2) correction is  
>>> omitted,
>>> why?
>>> as "event" changed, shouldn't beg and ensample follow this change?
> sticking to +/-3sec defined as star/end of trial? In fact, data.time  
> was
> shift. In the rest of the code i don't see any line related to this
> change.
>>> Any help will be welcome!
>>> Natalia
>>> .............................
>>> elseif ~isempty(cfg.offset)
>>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
>>> %%%%%%%%%%%
>>> % shift the time axis from each trial
>>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
>>> %%%%%%%%%%%
>>> offset = cfg.offset(:);
>>> if length(cfg.offset)==1
>>>   offset = repmat(offset, Ntrial, 1);
>>> end
>>> for i=1:Ntrial
>>>   data.time{i} = data.time{i} + offset(i)/data.fsample;
>>> end
>>> % also correct the trial definition
>>> if ~isempty(trl)
>>>   trl(:,3) = trl(:,3) + offset;
>>> end
>>> ........................................
>>> ----------------------------------------------------------------
>>> SISSA Webmail https://webmail.sissa.it/
>>> Powered by SquirrelMail http://www.squirrelmail.org/
>>> ----------------------------------------------------------------
>>> SISSA Webmail https://webmail.sissa.it/
>>> Powered by SquirrelMail http://www.squirrelmail.org/
>>> ----------------------------------
>>> The aim of this list is to facilitate the discussion between users  
>>> of
> the
>>> FieldTrip  toolbox, to share experiences and to discuss new ideas  
>>> for
> MEG
>>> and EEG analysis. See also
>>> http://listserv.surfnet.nl/archives/fieldtrip.html and
>>> http://www.ru.nl/neuroimaging/fieldtrip.
>>
>> ----------------------------------
>> The aim of this list is to facilitate the discussion between users of
> the
>> FieldTrip  toolbox, to share experiences and to discuss new ideas for
> MEG
>> and EEG analysis. See also
>> http://listserv.surfnet.nl/archives/fieldtrip.html and
>> http://www.ru.nl/neuroimaging/fieldtrip.
>
>
> ----------------------------------------------------------------
>  SISSA Webmail https://webmail.sissa.it/
>  Powered by SquirrelMail http://www.squirrelmail.org/
>
>
>
>
>
> ----------------------------------------------------------------
>  SISSA Webmail https://webmail.sissa.it/
>  Powered by SquirrelMail http://www.squirrelmail.org/
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users  
> of the FieldTrip  toolbox, to share experiences and to discuss new  
> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html 
>  and http://www.ru.nl/neuroimaging/fieldtrip.



Dr. J.M. (Jan-Mathijs) Schoffelen
Donders Institute for Brain, Cognition and Behaviour,
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands
J.Schoffelen at donders.ru.nl
Telephone: 0031-24-3668063

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From ElisabethSusanne.May at UNI-DUESSELDORF.DE  Fri Apr 16 15:51:13 2010
From: ElisabethSusanne.May at UNI-DUESSELDORF.DE (Elisabeth May)
Date: Fri, 16 Apr 2010 15:51:13 +0200
Subject: problem with automatic artifact detection
Message-ID: <FRI.16.APR.2010.155113.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Fieldtrip users,

I am trying to use Fieldtrip's automatic artifact detection on a new MEG
dataset (recorded with the Neuromag 306 system) and encountered a
problem that I didn't have before. During EOG artifact detection, I get
the following warning for each of my (300) trials:

".Reading 599676 ... 606076  =    299.838 ...   303.038 secs... [done]
Warning: Matrix is close to singular or badly scaled.
         Results may be inaccurate. RCOND = 7.730460e-17.
 > In filtfilt at 81
  In filtfilt at 49
  In preproc_bandpassfilter at 73
  In fieldtrip-20100208/private/preproc at 256
  In ft_artifact_zvalue at 149
  In artifact_zvalue at 17
  In ft_artifact_eog at 121
Warning: Matrix is close to singular or badly scaled.
         Results may be inaccurate. RCOND = 7.730460e-17.
 > In filtfilt at 81
  In filtfilt at 49
  In preproc_bandpassfilter at 73
  In fieldtrip-20100208/private/preproc at 256
  In ft_artifact_zvalue at 149
  In artifact_zvalue at 17
  In ft_artifact_eog at 121"

The function nevertheless runs through but the resulting z-scores don't
make sense (see the figure bad z-scores attached to this email for an
example of a trial). I have another dataset from the same recording
session with the same subject where a different paradigm was used. With
that paradigm, the artifact detection works fine (see figure good
z-scores). This was the same for another subject who did both of the
paradigms within one recording session. The only thing I could think of
that could be important and is different between the two paradigms /
datasets is the sampling frequency; the artifact detection seems to work
fine for a sampling frequency of 1000 Hz but not for a sampling
frequency of 2000 Hz.

Since the warning refers to preproc_bandpassfilter,  I tried to track
the steps of the filtering and plotted the data of a single trial and
one EOG channel before and after the application of the bandpass filter
during the EOG artifact detection routine. I did this for both the
paradigm that results in "normal" z-scores (figures good before
filtering and good after filtering) and for the one that results in the
z-scores that don't make sense (figures bad before filtering and bad
after filtering). I don't know very much about filters, but is it
possible that the settings for the filters are somehow not working /
calculated wrongly for the 2000 Hz sampling frequency? Or am I
completely on the wrong track? Has anyone else encountered this problem
before?

Thanks in advance for any help!

Best,
Elisabeth


--
Dipl.-Psych. Elisabeth May

Universitätsklinikum Düsseldorf
Institut für Klinische Neurowissenschaften und Medizinische Psychologie
Universitätsstr. 1
40225 Düsseldorf

Tel: +49 211 81-18075

http://www.uniklinik-duesseldorf.de/med-psychologie


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bad after filtering.jpg
Type: image/jpeg
Size: 13816 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/2cd235cc/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bad before filtering.jpg
Type: image/jpeg
Size: 29714 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/2cd235cc/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bad z-scores.jpg
Type: image/jpeg
Size: 67206 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/2cd235cc/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: good after filtering.jpg
Type: image/jpeg
Size: 18819 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/2cd235cc/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: good before filtering.jpg
Type: image/jpeg
Size: 22162 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/2cd235cc/attachment-0004.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: good z-scores.jpg
Type: image/jpeg
Size: 63844 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/2cd235cc/attachment-0005.jpg>

From ingrid.nieuwenhuis at FCDONDERS.RU.NL  Fri Apr 16 17:51:44 2010
From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis)
Date: Fri, 16 Apr 2010 17:51:44 +0200
Subject: problems making a template grid
In-Reply-To: <4BC57AF6.8050204@uni-muenster.de>
Message-ID: <FRI.16.APR.2010.175144.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Andreas,

1, I added a comment on the wiki, thanks for your suggestion
2, 'T1.mnc' is a smoothed template based on multiple subjects, to deal with
between subject variation in anatomy. This is needed for proper
normalization. Template distributed with spm (in templates folder)
'single_subj_T1.mnc' is a single subject template, needed for proper
segmentation. Also added this comment on the wiki.

Have a nice weekend,
Ingrid

------------------------------------
Ingrid L.C. Nieuwenhuis
PhD student
Donders Institute for Brain, Cognition and Behaviour,
Centre for Cognitive Neuroimaging
Radboud University Nijmegen, The Netherlands
Email: ingrid.nieuwenhuis at donders.ru.nl
Tel: 0031 (0)24 - 36 10887

-----Original Message-----
From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Andreas Wollbrink
Sent: Wednesday, April 14, 2010 10:21 AM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: [FIELDTRIP] problems making a template grid

Hi all,

I encountered some problems generating a template source grid as
described in the fieldtrip example matlab script 'Create MNI-aligned
grids in individual head-space':

1. in chapter 'Make the template_grid': Without defining a template
image in the cfg structure prior to use ft_volumesegment the default
setting cfg.template = '/home/common/matlab/spm2/templates/T1.mnc' is
used. Since this file might not exist in this specific folder on a
personal computer the function fails.
After defining cfg.template I succeed in using the function.
It might be helpful for others to add this comment to the example script.

2. My question at this point is: Should one use the individual template
'single_subj_T1.mnc' or the average template 'T1.mnc' to segment the
template brain and construct a volume conduction model?

3. Furtheron the function 'prepare_dipole_grid' could not be found. This
functions is placed in the private folder under fieldtrip. How can I
automatically add this folder to my matlab path?

Thanks,
Andreas

--


======================================================================

   Andreas Wollbrink, Biomedical Engineer

   Institute for Biomagnetism and Biosignalanalysis       	
   Muenster University Hospital

   Malmedyweg 15        phone:   +49-(0)251-83-52546
   D-48149 Muenster     fax:     +49-(0)251-83-56874	
   Germany
                        e-Mail: a.wollbrink at uni-muenster.de

======================================================================

----------------------------------
The aim of this list is to facilitate the discussion between users of the
FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
and EEG analysis. See also
http://listserv.surfnet.nl/archives/fieldtrip.html and
http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From a.wollbrink at UNI-MUENSTER.DE  Fri Apr 16 17:58:33 2010
From: a.wollbrink at UNI-MUENSTER.DE (Andreas Wollbrink)
Date: Fri, 16 Apr 2010 17:58:33 +0200
Subject: problems making a template grid
In-Reply-To: <20100416155138.63858109DBB@smtp.ru.nl>
Message-ID: <FRI.16.APR.2010.175833.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Ingrid,

Thanks for the info on the different MRI templates and their specific gain.

Have a nice weekend too,
Andreas

On 04/16/10 17:51, Ingrid Nieuwenhuis wrote:
> Hi Andreas,
>
> 1, I added a comment on the wiki, thanks for your suggestion
> 2, 'T1.mnc' is a smoothed template based on multiple subjects, to deal with
> between subject variation in anatomy. This is needed for proper
> normalization. Template distributed with spm (in templates folder)
> 'single_subj_T1.mnc' is a single subject template, needed for proper
> segmentation. Also added this comment on the wiki.
>
> Have a nice weekend,
> Ingrid
>
> ------------------------------------
> Ingrid L.C. Nieuwenhuis
> PhD student
> Donders Institute for Brain, Cognition and Behaviour,
> Centre for Cognitive Neuroimaging
> Radboud University Nijmegen, The Netherlands
> Email: ingrid.nieuwenhuis at donders.ru.nl
> Tel: 0031 (0)24 - 36 10887
>
> -----Original Message-----
> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
> Of Andreas Wollbrink
> Sent: Wednesday, April 14, 2010 10:21 AM
> To: FIELDTRIP at NIC.SURFNET.NL
> Subject: [FIELDTRIP] problems making a template grid
>
> Hi all,
>
> I encountered some problems generating a template source grid as
> described in the fieldtrip example matlab script 'Create MNI-aligned
> grids in individual head-space':
>
> 1. in chapter 'Make the template_grid': Without defining a template
> image in the cfg structure prior to use ft_volumesegment the default
> setting cfg.template = '/home/common/matlab/spm2/templates/T1.mnc' is
> used. Since this file might not exist in this specific folder on a
> personal computer the function fails.
> After defining cfg.template I succeed in using the function.
> It might be helpful for others to add this comment to the example script.
>
> 2. My question at this point is: Should one use the individual template
> 'single_subj_T1.mnc' or the average template 'T1.mnc' to segment the
> template brain and construct a volume conduction model?
>
> 3. Furtheron the function 'prepare_dipole_grid' could not be found. This
> functions is placed in the private folder under fieldtrip. How can I
> automatically add this folder to my matlab path?
>
> Thanks,
> Andreas
>

--


======================================================================

   Andreas Wollbrink, Biomedical Engineer

   Institute for Biomagnetism and Biosignalanalysis       	
   Muenster University Hospital

   Malmedyweg 15        phone:   +49-(0)251-83-52546
   D-48149 Muenster     fax:     +49-(0)251-83-56874	
   Germany
                        e-Mail: a.wollbrink at uni-muenster.de

======================================================================

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From stojanoski at UTSC.UTORONTO.CA  Fri Apr 16 17:50:13 2010
From: stojanoski at UTSC.UTORONTO.CA (Bobby Stojanoski)
Date: Fri, 16 Apr 2010 11:50:13 -0400
Subject: read_header linux
Message-ID: <FRI.16.APR.2010.115013.0400.FIELDTRIP@NIC.SURFNET.NL>

Hi Ingrid, and fellow fieldtrippers


 Thanks for your reply. Using the latest version of fieldtrip did the trick.



 I was also hoping to get some help with another issue I recently came
across. To increase computing power, I have switched my analysis over to a
computer running linux. The problem is when I run, freqanalysis, which uses
‘mytrialfun’, I get an error at hdr = read_header(cfg.dataset):

 ??? Error using ==> read_eep_cnt
Too many input arguments.

Error in ==> read_header at 830
    hdr = read_eep_cnt(filename, 1, 1);

Error in ==> mytrialfun at 28
hdr   = read_header(cfg.dataset);

 I followed the instructions from an earlier thread (Item #1211 (14 Jun 2007
16:33) - Re: read in EEProbe
data<https://listserv.surfnet.nl/scripts/wa.cgi?A2=ind0706&L=FIELDTRIP&P=R1849&X=0D167D31AC551D6E9F&Y=stojanoski%40utsc.utoronto.ca>),
with no success.

 The read_eep_cnt_mexglx file exists in the fieldtrip directory, and it does
seem to be reading it.

 Has anyone else had similar troubles using linux (ubuntu)?



Many thanks in advance!

 Bobby


-- 
Bobby Stojanoski
Ph.D. Candidate
CoNSens lab
Department of Psychology
University of Toronto Scarborough
stojanoski at utsc.utoronto.ca
www.utsc.utoronto.ca/~stojanoski

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/4b876b8d/attachment.htm>

From g.piantoni at NIN.KNAW.NL  Fri Apr 16 18:09:23 2010
From: g.piantoni at NIN.KNAW.NL (Giovanni Piantoni)
Date: Fri, 16 Apr 2010 18:09:23 +0200
Subject: reading EGI data
Message-ID: <FRI.16.APR.2010.180923.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear all,

I get this incredible error when I try to read EGI data. If the first
data point is odd, it works well (EGI_data_odd.png), while if the
first data point is even, then the result doesn't make much sense
(EGI_data_even.png).
You can replicate it with this data:
http://bit.ly/cdqzZH

and the following code:

cfg = [];
cfg.dataset = 'EGIrecording.raw';
cfg.trialdef.triallength = Inf;
def = ft_definetrial(cfg);
data = ft_preprocessing(def);
plot(data.trial{1}(1,:)) % odd

def.trl(1) = 2;
data = ft_preprocessing(def);
plot(data.trial{1}(1,:)) % even

Does anybody have an idea on what's going on?

Thanks,
Gio

-------------------------------------------------------------------------------------
MATLAB Version 7.9.0.529 (R2009b)
Operating System: Linux 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12
04:38:19 UTC 2010 x86_64
Java VM Version: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java
HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------

--
Giovanni Piantoni, Ph.D. student
Dept. Sleep & Cognition
Netherlands Institute for Neuroscience
Meibergdreef 47
1105 BA Amsterdam (NL)

+31 (0)20 5665492
g.piantoni at nin.knaw.nl
www.nin.knaw.nl/research_groups/van_someren_group/

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EGI_data_odd.png
Type: image/png
Size: 4716 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/770fba8a/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EGI_data_even.png
Type: image/png
Size: 2920 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/770fba8a/attachment-0001.png>

From aardesta at UCLA.EDU  Fri Apr 16 20:37:57 2010
From: aardesta at UCLA.EDU (Allen Ardestani)
Date: Fri, 16 Apr 2010 11:37:57 -0700
Subject: New FieldTrip User Questions
In-Reply-To: <017501cad1dc$fd5978b0$f80c6a10$@maris@donders.ru.nl>
Message-ID: <FRI.16.APR.2010.113757.0700.FIELDTRIP@NIC.SURFNET.NL>

Hi Eric,

Thank you very much for the advice.



1)      With regard to our frequency domain analysis, I've already used FFT
to look at general trends in the sample and delay periods but am interested
in plotting the evolution of those oscillations over trial time.  I believe
that the cluster analysis and MonteCarlo simulation are the best method to
adopt for quantifying difference between conditions, but please do correct
me if you have other suggestions.



2)      Another question is about the edge artifact of using multitapers at
ultralow frequencies on relatively short (57s) data segments.  Are
multitapers a good approach, and if so could padding help with the edge
artifact?



3)      On a separate note, do you have any functions available/coming for
computing spike-field coherence?  Thank you again.



Best,

Allen





____________________________________________________________________________
______

Allen Ardestani    Email:  <mailto:aardesta at ucla.edu> aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Eric Maris
Sent: Thursday, April 01, 2010 1:51 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] New FieldTrip User Questions



Hi Allen,



I just now came across the FieldTrip toolbox and have a few questions - I
apologize in advance if I am misusing this discussion forum or if my
questions are too obvious.  I am working with a very large dataset of
simultaneous LFP, unit, and NIRS signal from macaques for the purpose of
examining time and frequency dynamics of the signals in various cognitive
conditions.  I would like to implement the clustering/bootstrapping
methodology outlined in [Journal of Neuroscience Methods 164 (2007) 177-190]
to identify significant changes in synchronization and phase-locking.



The specific data in question are LFPs recorded while the monkeys perform a
working-memory task, which consists of a 2s visual sample, 20s delay, and
subsequent choice period.  A 20s baseline precedes the sample (t=0), which
is time-locked to the animal's foveation on the visual sample.  TF plots are
computed using Morlet wavelets for each trial, averaged across trials, and
then normalized with respect to the average baseline.  The first question
I'd like to address is: what time-frequency regions exhibit significant
difference between Correct (left plot) and Incorrect (right plot) trials.



cid:image002.jpg at 01CAA0E0.B7CEC3E0 cid:image003.jpg at 01CAA0E0.B7CEC3E0

I have a number of questions about the appropriateness of applying
bootstrapping to our specific dataset:

1)      Because we use wavelets for spectral decomposition (with
frequency-dependent changes in spectral and temporal resolution) is it valid
to simply cluster across different frequencies?



Yes it is. However, with your 20 sec. trials, I would not go for the high
temporal resolution that he wavelet transform gives you. I would do one
Fourier-based analyses for the first 2 seconds (encoding stage) and another
one for the rest of the trial (retention stage).



2)      We are interested in comparing different conditions, where each is
computed relative to its own baseline.  Is there anything wrong with using
the baselines of the same dataset for the null distribution as opposed to
using a different set of baseline data?



Do not baseline correct your data. Compare the raw power spectra for the
correct response trials with those of the incorrect response condition.



3)      The data have been recorded at 1KHz, and this oversampling results
in high spatial-frequency noise.  Do I need to do any downsampling/smoothing
before applying the statistics?





No. However, with such long trials, I would definitely smooth in the
frequency domain using multitapers (also available in Fieldtrip).





4)      For evaluating the relationship between channels, we compute the
phase-locking value (PLV), which has no meaningful single-trial
measuremetnt.  Is there any way to apply statistical analyses directly to
the average TF plots without resorting back to the individual trials?



Have look at the paper by Maris, Schoffelen, and Fries (2007, JNM) that
describes cluster-based permutation tests for coherence differences. This
may be what you need.







Best,

















____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/1926b207/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 18296 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/1926b207/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 17871 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/1926b207/attachment-0001.jpg>

From e.maris at DONDERS.RU.NL  Fri Apr 16 22:02:16 2010
From: e.maris at DONDERS.RU.NL (Eric Maris)
Date: Fri, 16 Apr 2010 22:02:16 +0200
Subject: New FieldTrip User Questions
In-Reply-To: <000001cadd93$f0350ce0$d09f26a0$@edu>
Message-ID: <FRI.16.APR.2010.220216.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Allen,





1)      With regard to our frequency domain analysis, I've already used FFT
to look at general trends in the sample and delay periods but am interested
in plotting the evolution of those oscillations over trial time.  I believe
that the cluster analysis and MonteCarlo simulation are the best method to
adopt for quantifying difference between conditions, but please do correct
me if you have other suggestions.



The cluster-based permutation tests are for testing differences between
conditions, not for characterizing temporal evolution (unless you mean by
"temporal evolution" a mean power difference between the first part and the
second part of the trials).



2)      Another question is about the edge artifact of using multitapers at
ultralow frequencies on relatively short (57s) data segments.  Are
multitapers a good approach, and if so could padding help with the edge
artifact?



Do you call 57s short? With such a huge trial length, you definitely need
multitapers! I'm not aware of any edge artifact using dpss tapers.



3)      On a separate note, do you have any functions available/coming for
computing spike-field coherence?  Thank you again.



There are no special SFC-functions in FT, as far as I know. In my own
experience, running a coherence analysis on mixed LFP-spike data works fine.
But I have not studied this, and there may be room for improvement .





Best,



Eric









Best,

Allen





____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Eric Maris
Sent: Thursday, April 01, 2010 1:51 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] New FieldTrip User Questions



Hi Allen,



I just now came across the FieldTrip toolbox and have a few questions - I
apologize in advance if I am misusing this discussion forum or if my
questions are too obvious.  I am working with a very large dataset of
simultaneous LFP, unit, and NIRS signal from macaques for the purpose of
examining time and frequency dynamics of the signals in various cognitive
conditions.  I would like to implement the clustering/bootstrapping
methodology outlined in [Journal of Neuroscience Methods 164 (2007) 177-190]
to identify significant changes in synchronization and phase-locking.



The specific data in question are LFPs recorded while the monkeys perform a
working-memory task, which consists of a 2s visual sample, 20s delay, and
subsequent choice period.  A 20s baseline precedes the sample (t=0), which
is time-locked to the animal's foveation on the visual sample.  TF plots are
computed using Morlet wavelets for each trial, averaged across trials, and
then normalized with respect to the average baseline.  The first question
I'd like to address is: what time-frequency regions exhibit significant
difference between Correct (left plot) and Incorrect (right plot) trials.



cid:image002.jpg at 01CAA0E0.B7CEC3E0 cid:image003.jpg at 01CAA0E0.B7CEC3E0

I have a number of questions about the appropriateness of applying
bootstrapping to our specific dataset:

1)      Because we use wavelets for spectral decomposition (with
frequency-dependent changes in spectral and temporal resolution) is it valid
to simply cluster across different frequencies?



Yes it is. However, with your 20 sec. trials, I would not go for the high
temporal resolution that he wavelet transform gives you. I would do one
Fourier-based analyses for the first 2 seconds (encoding stage) and another
one for the rest of the trial (retention stage).



2)      We are interested in comparing different conditions, where each is
computed relative to its own baseline.  Is there anything wrong with using
the baselines of the same dataset for the null distribution as opposed to
using a different set of baseline data?



Do not baseline correct your data. Compare the raw power spectra for the
correct response trials with those of the incorrect response condition.



3)      The data have been recorded at 1KHz, and this oversampling results
in high spatial-frequency noise.  Do I need to do any downsampling/smoothing
before applying the statistics?





No. However, with such long trials, I would definitely smooth in the
frequency domain using multitapers (also available in Fieldtrip).





4)      For evaluating the relationship between channels, we compute the
phase-locking value (PLV), which has no meaningful single-trial
measuremetnt.  Is there any way to apply statistical analyses directly to
the average TF plots without resorting back to the individual trials?



Have look at the paper by Maris, Schoffelen, and Fries (2007, JNM) that
describes cluster-based permutation tests for coherence differences. This
may be what you need.







Best,

















____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/d1f2cf0e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 18296 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/d1f2cf0e/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 17871 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/d1f2cf0e/attachment-0001.jpg>

From aardesta at UCLA.EDU  Fri Apr 16 22:38:52 2010
From: aardesta at UCLA.EDU (Allen Ardestani)
Date: Fri, 16 Apr 2010 13:38:52 -0700
Subject: New FieldTrip User Questions
In-Reply-To: <00e901cadd9f$b68357c0$238a0740$@maris@donders.ru.nl>
Message-ID: <FRI.16.APR.2010.133852.0700.FIELDTRIP@NIC.SURFNET.NL>

Thanks, Eric.  Please see below.





1)      With regard to our frequency domain analysis, I've already used FFT
to look at general trends in the sample and delay periods but am interested
in plotting the evolution of those oscillations over trial time.  I believe
that the cluster analysis and MonteCarlo simulation are the best method to
adopt for quantifying difference between conditions, but please do correct
me if you have other suggestions.



The cluster-based permutation tests are for testing differences between
conditions, not for characterizing temporal evolution (unless you mean by
"temporal evolution" a mean power difference between the first part and the
second part of the trials).



By temporal evolution I'm referring to the continuous changes in the TFR map
over the course of our long trials.  It is difficult to categorize these
into discrete epochs (e.g., early, middle, late delay) without diluting some
of the effect, so I would like to analyze the entire TFR without any further
subdivision.  I would like to compare the entire TFR obtained during
different conditions for areas of significant difference.  Am I
understanding correctly that the cluster-based permutations are the best way
to approach this question?



2)      Another question is about the edge artifact of using multitapers at
ultralow frequencies on relatively short (57s) data segments.  Are
multitapers a good approach, and if so could padding help with the edge
artifact?



Do you call 57s short? With such a huge trial length, you definitely need
multitapers! I'm not aware of any edge artifact using dpss tapers.



Apologies for the confusion.  This question pertains to a different set of
NIRS data for which I am interested in looking at changes only in the <0.1Hz
range.  At frequencies this low, where we get just four or less cycles per
entire trial, the trials are relatively short.  In this type of setting, is
it possible to get reliable measures of power with a reasonable temporal
resolution?



3)      On a separate note, do you have any functions available/coming for
computing spike-field coherence?  Thank you again.



There are no special SFC-functions in FT, as far as I know. In my own
experience, running a coherence analysis on mixed LFP-spike data works fine.
But I have not studied this, and there may be room for improvement .



Under the "Animal Electrophysiology" section of the tutorial I saw a
subheading of "Spike-Field Coherence" that appears under development.  I was
just hoping for any new updates.





Thank you so much again for your help.



Thanks,

Allen





Best,



Eric









Best,

Allen





____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Eric Maris
Sent: Thursday, April 01, 2010 1:51 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] New FieldTrip User Questions



Hi Allen,



I just now came across the FieldTrip toolbox and have a few questions - I
apologize in advance if I am misusing this discussion forum or if my
questions are too obvious.  I am working with a very large dataset of
simultaneous LFP, unit, and NIRS signal from macaques for the purpose of
examining time and frequency dynamics of the signals in various cognitive
conditions.  I would like to implement the clustering/bootstrapping
methodology outlined in [Journal of Neuroscience Methods 164 (2007) 177-190]
to identify significant changes in synchronization and phase-locking.



The specific data in question are LFPs recorded while the monkeys perform a
working-memory task, which consists of a 2s visual sample, 20s delay, and
subsequent choice period.  A 20s baseline precedes the sample (t=0), which
is time-locked to the animal's foveation on the visual sample.  TF plots are
computed using Morlet wavelets for each trial, averaged across trials, and
then normalized with respect to the average baseline.  The first question
I'd like to address is: what time-frequency regions exhibit significant
difference between Correct (left plot) and Incorrect (right plot) trials.



cid:image002.jpg at 01CAA0E0.B7CEC3E0 cid:image003.jpg at 01CAA0E0.B7CEC3E0

I have a number of questions about the appropriateness of applying
bootstrapping to our specific dataset:

1)      Because we use wavelets for spectral decomposition (with
frequency-dependent changes in spectral and temporal resolution) is it valid
to simply cluster across different frequencies?



Yes it is. However, with your 20 sec. trials, I would not go for the high
temporal resolution that he wavelet transform gives you. I would do one
Fourier-based analyses for the first 2 seconds (encoding stage) and another
one for the rest of the trial (retention stage).



2)      We are interested in comparing different conditions, where each is
computed relative to its own baseline.  Is there anything wrong with using
the baselines of the same dataset for the null distribution as opposed to
using a different set of baseline data?



Do not baseline correct your data. Compare the raw power spectra for the
correct response trials with those of the incorrect response condition.



3)      The data have been recorded at 1KHz, and this oversampling results
in high spatial-frequency noise.  Do I need to do any downsampling/smoothing
before applying the statistics?





No. However, with such long trials, I would definitely smooth in the
frequency domain using multitapers (also available in Fieldtrip).





4)      For evaluating the relationship between channels, we compute the
phase-locking value (PLV), which has no meaningful single-trial
measuremetnt.  Is there any way to apply statistical analyses directly to
the average TF plots without resorting back to the individual trials?



Have look at the paper by Maris, Schoffelen, and Fries (2007, JNM) that
describes cluster-based permutation tests for coherence differences. This
may be what you need.







Best,

















____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/3e809cf6/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 18296 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/3e809cf6/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 17871 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/3e809cf6/attachment-0001.jpg>

From e.maris at DONDERS.RU.NL  Fri Apr 16 23:05:25 2010
From: e.maris at DONDERS.RU.NL (Eric Maris)
Date: Fri, 16 Apr 2010 23:05:25 +0200
Subject: New FieldTrip User Questions
In-Reply-To: <003701cadda4$d3d1d680$7b758380$@edu>
Message-ID: <FRI.16.APR.2010.230525.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Allen,



1)      With regard to our frequency domain analysis, I've already used FFT
to look at general trends in the sample and delay periods but am interested
in plotting the evolution of those oscillations over trial time.  I believe
that the cluster analysis and MonteCarlo simulation are the best method to
adopt for quantifying difference between conditions, but please do correct
me if you have other suggestions.



The cluster-based permutation tests are for testing differences between
conditions, not for characterizing temporal evolution (unless you mean by
"temporal evolution" a mean power difference between the first part and the
second part of the trials).



By temporal evolution I'm referring to the continuous changes in the TFR map
over the course of our long trials.  It is difficult to categorize these
into discrete epochs (e.g., early, middle, late delay) without diluting some
of the effect, so I would like to analyze the entire TFR without any further
subdivision.  I would like to compare the entire TFR obtained during
different conditions for areas of significant difference.  Am I
understanding correctly that the cluster-based permutations are the best way
to approach this question?



Yes.







2)      Another question is about the edge artifact of using multitapers at
ultralow frequencies on relatively short (57s) data segments.  Are
multitapers a good approach, and if so could padding help with the edge
artifact?



Do you call 57s short? With such a huge trial length, you definitely need
multitapers! I'm not aware of any edge artifact using dpss tapers.



Apologies for the confusion.  This question pertains to a different set of
NIRS data for which I am interested in looking at changes only in the <0.1Hz
range.  At frequencies this low, where we get just four or less cycles per
entire trial, the trials are relatively short.  In this type of setting, is
it possible to get reliable measures of power with a reasonable temporal
resolution?



The reliability of power estimate will depend on the number of trials over
which you average your single-trial power estimates. Your temporal
resolution is given by the length of your analysis window, which is 57s in
your case.



3)      On a separate note, do you have any functions available/coming for
computing spike-field coherence?  Thank you again.



There are no special SFC-functions in FT, as far as I know. In my own
experience, running a coherence analysis on mixed LFP-spike data works fine.
But I have not studied this, and there may be room for improvement .



Under the "Animal Electrophysiology" section of the tutorial I saw a
subheading of "Spike-Field Coherence" that appears under development.  I was
just hoping for any new updates.



I'm sorry, no I haven't finished this project yet.





Best,



Eric









Thank you so much again for your help.



Thanks,

Allen





Best,



Eric









Best,

Allen





____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Eric Maris
Sent: Thursday, April 01, 2010 1:51 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] New FieldTrip User Questions



Hi Allen,



I just now came across the FieldTrip toolbox and have a few questions - I
apologize in advance if I am misusing this discussion forum or if my
questions are too obvious.  I am working with a very large dataset of
simultaneous LFP, unit, and NIRS signal from macaques for the purpose of
examining time and frequency dynamics of the signals in various cognitive
conditions.  I would like to implement the clustering/bootstrapping
methodology outlined in [Journal of Neuroscience Methods 164 (2007) 177-190]
to identify significant changes in synchronization and phase-locking.



The specific data in question are LFPs recorded while the monkeys perform a
working-memory task, which consists of a 2s visual sample, 20s delay, and
subsequent choice period.  A 20s baseline precedes the sample (t=0), which
is time-locked to the animal's foveation on the visual sample.  TF plots are
computed using Morlet wavelets for each trial, averaged across trials, and
then normalized with respect to the average baseline.  The first question
I'd like to address is: what time-frequency regions exhibit significant
difference between Correct (left plot) and Incorrect (right plot) trials.



cid:image002.jpg at 01CAA0E0.B7CEC3E0 cid:image003.jpg at 01CAA0E0.B7CEC3E0

I have a number of questions about the appropriateness of applying
bootstrapping to our specific dataset:

1)      Because we use wavelets for spectral decomposition (with
frequency-dependent changes in spectral and temporal resolution) is it valid
to simply cluster across different frequencies?



Yes it is. However, with your 20 sec. trials, I would not go for the high
temporal resolution that he wavelet transform gives you. I would do one
Fourier-based analyses for the first 2 seconds (encoding stage) and another
one for the rest of the trial (retention stage).



2)      We are interested in comparing different conditions, where each is
computed relative to its own baseline.  Is there anything wrong with using
the baselines of the same dataset for the null distribution as opposed to
using a different set of baseline data?



Do not baseline correct your data. Compare the raw power spectra for the
correct response trials with those of the incorrect response condition.



3)      The data have been recorded at 1KHz, and this oversampling results
in high spatial-frequency noise.  Do I need to do any downsampling/smoothing
before applying the statistics?





No. However, with such long trials, I would definitely smooth in the
frequency domain using multitapers (also available in Fieldtrip).





4)      For evaluating the relationship between channels, we compute the
phase-locking value (PLV), which has no meaningful single-trial
measuremetnt.  Is there any way to apply statistical analyses directly to
the average TF plots without resorting back to the individual trials?



Have look at the paper by Maris, Schoffelen, and Fries (2007, JNM) that
describes cluster-based permutation tests for coherence differences. This
may be what you need.







Best,

















____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/25587cb3/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 18296 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/25587cb3/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 17871 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/25587cb3/attachment-0001.jpg>

From aardesta at UCLA.EDU  Fri Apr 16 23:24:04 2010
From: aardesta at UCLA.EDU (Allen Ardestani)
Date: Fri, 16 Apr 2010 14:24:04 -0700
Subject: New FieldTrip User Questions
In-Reply-To: <010901cadda8$890b64f0$9b222ed0$@maris@donders.ru.nl>
Message-ID: <FRI.16.APR.2010.142404.0700.FIELDTRIP@NIC.SURFNET.NL>

Thank you for clarifying.  One more question below.



1)      With regard to our frequency domain analysis, I've already used FFT
to look at general trends in the sample and delay periods but am interested
in plotting the evolution of those oscillations over trial time.  I believe
that the cluster analysis and MonteCarlo simulation are the best method to
adopt for quantifying difference between conditions, but please do correct
me if you have other suggestions.



The cluster-based permutation tests are for testing differences between
conditions, not for characterizing temporal evolution (unless you mean by
"temporal evolution" a mean power difference between the first part and the
second part of the trials).



By temporal evolution I'm referring to the continuous changes in the TFR map
over the course of our long trials.  It is difficult to categorize these
into discrete epochs (e.g., early, middle, late delay) without diluting some
of the effect, so I would like to analyze the entire TFR without any further
subdivision.  I would like to compare the entire TFR obtained during
different conditions for areas of significant difference.  Am I
understanding correctly that the cluster-based permutations are the best way
to approach this question?



Yes.



I use wavelets to compute the TFRs as below.  Can I then use multitapers for
further smoothing?









Thank you so much again!



Best,

Allen





____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Eric Maris
Sent: Thursday, April 01, 2010 1:51 PM
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] New FieldTrip User Questions



Hi Allen,



I just now came across the FieldTrip toolbox and have a few questions - I
apologize in advance if I am misusing this discussion forum or if my
questions are too obvious.  I am working with a very large dataset of
simultaneous LFP, unit, and NIRS signal from macaques for the purpose of
examining time and frequency dynamics of the signals in various cognitive
conditions.  I would like to implement the clustering/bootstrapping
methodology outlined in [Journal of Neuroscience Methods 164 (2007) 177-190]
to identify significant changes in synchronization and phase-locking.



The specific data in question are LFPs recorded while the monkeys perform a
working-memory task, which consists of a 2s visual sample, 20s delay, and
subsequent choice period.  A 20s baseline precedes the sample (t=0), which
is time-locked to the animal's foveation on the visual sample.  TF plots are
computed using Morlet wavelets for each trial, averaged across trials, and
then normalized with respect to the average baseline.  The first question
I'd like to address is: what time-frequency regions exhibit significant
difference between Correct (left plot) and Incorrect (right plot) trials.



cid:image002.jpg at 01CAA0E0.B7CEC3E0 cid:image003.jpg at 01CAA0E0.B7CEC3E0

I have a number of questions about the appropriateness of applying
bootstrapping to our specific dataset:

1)      Because we use wavelets for spectral decomposition (with
frequency-dependent changes in spectral and temporal resolution) is it valid
to simply cluster across different frequencies?



Yes it is. However, with your 20 sec. trials, I would not go for the high
temporal resolution that he wavelet transform gives you. I would do one
Fourier-based analyses for the first 2 seconds (encoding stage) and another
one for the rest of the trial (retention stage).



2)      We are interested in comparing different conditions, where each is
computed relative to its own baseline.  Is there anything wrong with using
the baselines of the same dataset for the null distribution as opposed to
using a different set of baseline data?



Do not baseline correct your data. Compare the raw power spectra for the
correct response trials with those of the incorrect response condition.



3)      The data have been recorded at 1KHz, and this oversampling results
in high spatial-frequency noise.  Do I need to do any downsampling/smoothing
before applying the statistics?





No. However, with such long trials, I would definitely smooth in the
frequency domain using multitapers (also available in Fieldtrip).





4)      For evaluating the relationship between channels, we compute the
phase-locking value (PLV), which has no meaningful single-trial
measuremetnt.  Is there any way to apply statistical analyses directly to
the average TF plots without resorting back to the individual trials?



Have look at the paper by Maris, Schoffelen, and Fries (2007, JNM) that
describes cluster-based permutation tests for coherence differences. This
may be what you need.







Best,

















____________________________________________________________________________
______

Allen Ardestani    Email: aardesta at ucla.edu

Phone: (310) 825-5528

Medical Scientist Training Program

David Geffen School of Medicine at UCLA

Semel Institute for Neuroscience and Human Behavior

760 Westwood Plaza

Los Angeles, CA 90095-1759

USA



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/fff6a35e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 18296 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/fff6a35e/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 17871 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/fff6a35e/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 13002 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100416/fff6a35e/attachment-0002.jpg>

From m.bauer at UCL.AC.UK  Sat Apr 17 02:45:13 2010
From: m.bauer at UCL.AC.UK (Markus Bauer)
Date: Sat, 17 Apr 2010 01:45:13 +0100
Subject: manually specifying fiducial positions in MRI structure
Message-ID: <SAT.17.APR.2010.014513.0100.FIELDTRIP@NIC.SURFNET.NL>

Hi

I have been using the new *SPM mesh* (fitted to the individual MRI by
the inverse transformation matrix of MRI -> MNI) *for creating forward
models for source-analysis for CTF data in fieldtrip.*

That works quite well, however, when trying to plot the results in
fieldtrip I face the problem that the *sources and the MRI *(read into
fieldtrip using read_mri and the SPM8 toolbox) *have different
coordinate systems*.

How can I recompute the coordinates of the MRI so that it is in
fieldtrip (CTF-head-coordinates) format?
I have the fiducial info from SPM available...
Is it possible to do sth like:

pos = mri.transform * mri.ind;
pos = pos - fiducial.pos; %or whatever - do a translation to the origin
of the 'new coordinate system'
mri.transform = pos  / ind;

??
or is it also necessary to flip the dimensions / specify further info??
cause I think MRI's in SPM have the x- and y-axis flipped compared to
the CTF/fieldtrip headmodel format...

Any suggestions would be appreciated, thanks
Markus

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100417/84303e80/attachment.htm>

From jdien07 at MAC.COM  Sat Apr 17 06:15:44 2010
From: jdien07 at MAC.COM (Joseph Dien)
Date: Sat, 17 Apr 2010 00:15:44 -0400
Subject: FieldTrip cellfun.m function destabilizing Matlab
In-Reply-To: <4BC90499.5060909@ucl.ac.uk>
Message-ID: <SAT.17.APR.2010.001544.0400.FIELDTRIP@NIC.SURFNET.NL>

Hi,
   I've been plagued by some odd behavior in Matlab, also reported by other users of my EP Toolkit (which requires installation of FieldTrip).  I've been able to isolate the cause as being the cellfun.m "upgrade" that is located in the compat/R13 and compat/R14 folders of the FieldTrip distribution.  When FieldTrip's version of cellfun.m is included in the path, a number of strange things happens (in this particular case, using Matlab 2008a on an Intel Mac under OS 10.6.2 but also seen in other configurations to at least some degree):

1) The following command stops working and produces the following error:

[fileNames, pathname] = uigetfile

??? Cell contents reference from a non-cell array object.

Error in ==> cellfun at 21
    argin{j} = varargin{j}{i};

Error in ==> iscellstr at 13
  res = cellfun('isclass',s,'char');

Error in ==> cell.ismember at 27
if ~((ischar(a) || iscellstr(a)) && (ischar(s) || iscellstr(s)))

Error in ==> AbstractFileDialog.AbstractFileDialog>AbstractFileDialog.set.InitialFileName at 71
            if any(ismember({'.', '..'}, iFile))

Error in ==> AbstractFileDialog.AbstractFileDialog>AbstractFileDialog.initialize at 259
            obj.InitialFileName = '';

Error in ==> UiFileOpenDialog.UiFileOpenDialog>UiFileOpenDialog.initialize at 121
            initialize at AbstractFileDialog(obj);

Error in ==> AbstractFileDialog.AbstractFileDialog>AbstractFileDialog.AbstractFileDialog at 26
            initialize(obj);

Error in ==> UiFileOpenDialog.UiFileOpenDialog>UiFileOpenDialog.UiFileOpenDialog at 9
        function obj = UiFileOpenDialog(varargin)

Error in ==> uigetputfile_helper at 40
    ufd = UiFileOpenDialog();

Error in ==> uigetfile at 125
    [filename, pathname, filterindex] = uigetputfile_helper(0, varargin{:});

2) The path listings becomes erratic.  Things happen like the FieldTrip paths disappear from the list, Matlab claims that a function is not on the path when you try to add a breakpoint to it even though it is indeed still on the path and being recognized by the "which" function etc. etc.

So first of all, I'd like to warn users of FieldTrip who are experiencing symptoms like this to make sure to drop the offending FieldTrip function from their path.  Unfortunately, I expect that some of the FieldTrip functions are depending on the presence of this "upgraded" cellfun.m function and will not work properly so I'm not sure what the effect of doing so is.

Second of all, I'd like to suggest to the developers that we should try to avoid replacing built-in Matlab functions as it can have unexpected effects on the rest of the system.  As I recall, we had to drop the Biosig Toolbox from the FieldTrip distribution for much the same reason.

Finally, I would be most obliged if the relevant FieldTrip developers could implement a fix for this problem.

Thanks!

Joe



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

Joseph Dien,
Senior Research Scientist
University of Maryland

E-mail: jdien at umd.edu
Phone: 301-226-8848
Fax: 301-226-8811
http://homepage.mac.com/jdien07/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100417/3689076c/attachment.htm>

From jdien07 at MAC.COM  Sat Apr 17 08:41:11 2010
From: jdien07 at MAC.COM (Joseph Dien)
Date: Sat, 17 Apr 2010 02:41:11 -0400
Subject: reading EGI data
In-Reply-To: <q2vdf319d4d1004160909sca367712q22ae14b933fe92eb@mail.gmail.com>
Message-ID: <SAT.17.APR.2010.024111.0400.FIELDTRIP@NIC.SURFNET.NL>

Hi,
    yeah, there's a bug in the code.  When someone added support for unsegmented files to my EGI simple binary file format code, it appears they didn't test it very well.  There's been a number of problems.  In this case, instead of just skipping the first sample, it's skipping hdr.nChans+Nevents samples, resulting in mangled data.

I'm at a conference right now but as soon as I get home I'll post a fix and let you know that it's done.  Sigh...

Joe



On Apr 16, 2010, at 12:09 PM, Giovanni Piantoni wrote:

> Dear all,
>
> I get this incredible error when I try to read EGI data. If the first
> data point is odd, it works well (EGI_data_odd.png), while if the
> first data point is even, then the result doesn't make much sense
> (EGI_data_even.png).
> You can replicate it with this data:
> http://bit.ly/cdqzZH
>
> and the following code:
>
> cfg = [];
> cfg.dataset = 'EGIrecording.raw';
> cfg.trialdef.triallength = Inf;
> def = ft_definetrial(cfg);
> data = ft_preprocessing(def);
> plot(data.trial{1}(1,:)) % odd
>
> def.trl(1) = 2;
> data = ft_preprocessing(def);
> plot(data.trial{1}(1,:)) % even
>
> Does anybody have an idea on what's going on?
>
> Thanks,
> Gio
>
> -------------------------------------------------------------------------------------
> MATLAB Version 7.9.0.529 (R2009b)
> Operating System: Linux 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12
> 04:38:19 UTC 2010 x86_64
> Java VM Version: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java
> HotSpot(TM) 64-Bit Server VM mixed mode
> -------------------------------------------------------------------------------------
>
> --
> Giovanni Piantoni, Ph.D. student
> Dept. Sleep & Cognition
> Netherlands Institute for Neuroscience
> Meibergdreef 47
> 1105 BA Amsterdam (NL)
>
> +31 (0)20 5665492
> g.piantoni at nin.knaw.nl
> www.nin.knaw.nl/research_groups/van_someren_group/
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
> <EGI_data_odd.png><EGI_data_even.png>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From jdien07 at MAC.COM  Sat Apr 17 08:58:26 2010
From: jdien07 at MAC.COM (Joseph Dien)
Date: Sat, 17 Apr 2010 02:58:26 -0400
Subject: reading EGI data
In-Reply-To: <5DBF1C39-1B1E-4D42-AE2F-08DECB26C5D2@mac.com>
Message-ID: <SAT.17.APR.2010.025826.0400.FIELDTRIP@NIC.SURFNET.NL>

Try this as a replacement for the read_sbin_data.m file.  It fixes the problem (which, contrary to what I just said, is that the unsegmented data code someone added was assuming the files are always int16 whereas your data is single, so it wasn't skipping the correct number of bytes).  It's based on the fieldtrip-20100406 release rather than today's release but should be good enough until I can get the fix posted.  Let me know if there are any further problems.

function [trialData] = read_sbin_data(filename, hdr, begtrial, endtrial, chanindx)

% READ_SBIN_DATA reads the data from an EGI segmented simple binary format file
%
% Use as
%   [trialData] = read_sbin_data(filename, hdr, begtrial, endtrial, chanindx)
% with
%   filename       name of the input file
%   hdr            header structure, see READ_HEADER
%   begtrial       first trial to read, mutually exclusive with begsample+endsample
%   endtrial       last trial to read,  mutually exclusive with begsample+endsample
%   chanindx       list with channel indices to read
%
% This function returns a 3-D matrix of size Nchans*Nsamples*Ntrials.
%_______________________________________________________________________
%
%
% Modified from EGI's readEGLY.m with permission 2008-03-31 Joseph Dien
%

% Subversion does not use the Log keyword, use 'svn log <filename>' or 'svn -v log | less' to get detailled information

fh=fopen([filename],'r');
if fh==-1
  error('wrong filename')
end

version = fread(fh,1,'int32');

%check byteorder
[str,maxsize,cEndian]=computer;
if version < 7
  if cEndian == 'B'
    endian = 'ieee-be';
  elseif cEndian == 'L'
    endian = 'ieee-le';
  end;
elseif (version > 6) && ~bitand(version,6)
  if cEndian == 'B'
    endian = 'ieee-le';
  elseif cEndian == 'L'
    endian = 'ieee-be';
  end;
  version = swapbytes(uint32(version)); %hdr.orig.header_array is already byte-swapped
else
    error('ERROR:  This is not a simple binary file.  Note that NetStation does not successfully directly convert EGIS files to simple binary format.\n');
end;

if bitand(version,1) == 0
    unsegmented = 1;
else
    unsegmented = 0;
end;

precision = bitand(version,6);
Nevents=hdr.orig.header_array(17);

switch precision
    case 2
        trialLength=2*hdr.nSamples*(hdr.nChans+Nevents)+6;
        dataType='int16';
        dataLength=2;
    case 4
        trialLength=4*hdr.nSamples*(hdr.nChans+Nevents)+6;
        dataType='single';
        dataLength=4;
    case 6
        trialLength=8*hdr.nSamples*(hdr.nChans+Nevents)+6;
        dataType='double';
        dataLength=8;
end

if unsegmented
    %interpret begtrial and endtrial as sample indices
    fseek(fh, 36+Nevents*4, 'bof'); %skip over header
    fseek(fh, ((begtrial-1)*(hdr.nChans+Nevents)*dataLength), 'cof'); %skip previous trials
    nSamples  = endtrial-begtrial+1;
    trialData = fread(fh, [hdr.nChans+Nevents, nSamples],dataType,endian);
else
    fseek(fh, 40+length(hdr.orig.CatLengths)+sum(hdr.orig.CatLengths)+Nevents*4, 'bof'); %skip over header
    fseek(fh, (begtrial-1)*trialLength, 'cof'); %skip over initial segments

    trialData=zeros(hdr.nChans,hdr.nSamples,endtrial-begtrial+1);

    for segment=1:(endtrial-begtrial+1)
        fseek(fh, 6, 'cof'); %skip over segment info
        temp = fread(fh, [(hdr.nChans+Nevents), hdr.nSamples],dataType,endian);
        trialData(:,:,segment) = temp(1:hdr.nChans,:);
    end
end
trialData=trialData(chanindx, :,:);
fclose(fh);




On Apr 17, 2010, at 2:41 AM, Joseph Dien wrote:

> Hi,
>    yeah, there's a bug in the code.  When someone added support for unsegmented files to my EGI simple binary file format code, it appears they didn't test it very well.  There's been a number of problems.  In this case, instead of just skipping the first sample, it's skipping hdr.nChans+Nevents samples, resulting in mangled data.
>
> I'm at a conference right now but as soon as I get home I'll post a fix and let you know that it's done.  Sigh...
>
> Joe
>
>
>
> On Apr 16, 2010, at 12:09 PM, Giovanni Piantoni wrote:
>
>> Dear all,
>>
>> I get this incredible error when I try to read EGI data. If the first
>> data point is odd, it works well (EGI_data_odd.png), while if the
>> first data point is even, then the result doesn't make much sense
>> (EGI_data_even.png).
>> You can replicate it with this data:
>> http://bit.ly/cdqzZH
>>
>> and the following code:
>>
>> cfg = [];
>> cfg.dataset = 'EGIrecording.raw';
>> cfg.trialdef.triallength = Inf;
>> def = ft_definetrial(cfg);
>> data = ft_preprocessing(def);
>> plot(data.trial{1}(1,:)) % odd
>>
>> def.trl(1) = 2;
>> data = ft_preprocessing(def);
>> plot(data.trial{1}(1,:)) % even
>>
>> Does anybody have an idea on what's going on?
>>
>> Thanks,
>> Gio
>>
>> -------------------------------------------------------------------------------------
>> MATLAB Version 7.9.0.529 (R2009b)
>> Operating System: Linux 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12
>> 04:38:19 UTC 2010 x86_64
>> Java VM Version: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java
>> HotSpot(TM) 64-Bit Server VM mixed mode
>> -------------------------------------------------------------------------------------
>>
>> --
>> Giovanni Piantoni, Ph.D. student
>> Dept. Sleep & Cognition
>> Netherlands Institute for Neuroscience
>> Meibergdreef 47
>> 1105 BA Amsterdam (NL)
>>
>> +31 (0)20 5665492
>> g.piantoni at nin.knaw.nl
>> www.nin.knaw.nl/research_groups/van_someren_group/
>>
>> ----------------------------------
>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
>> <EGI_data_odd.png><EGI_data_even.png>
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100417/acf24e83/attachment.htm>

From v.litvak at ION.UCL.AC.UK  Sat Apr 17 09:17:39 2010
From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak)
Date: Sat, 17 Apr 2010 08:17:39 +0100
Subject: manually specifying fiducial positions in MRI structure
In-Reply-To: <4BC90499.5060909@ucl.ac.uk>
Message-ID: <SAT.17.APR.2010.081739.0100.FIELDTRIP@NIC.SURFNET.NL>

Hi Markus,

When building the head model SPM generated some .gii files that should
be at the same location where your individual MRIs were. If you load
the one corresponding to the cortex with something like:

m = export(gifti('filename.gii'), 'ft');

you can take m.pnt and put it in the source structure instead of
source.pos there. Then you'll have matching coordinate systems. There
are also some other ways to do it but this one is the simplest to
explain.

Best,

Vladimir

On Sat, Apr 17, 2010 at 1:45 AM, Markus Bauer <m.bauer at ucl.ac.uk> wrote:
> Hi
>
> I have been using the new SPM mesh (fitted to the individual MRI by the
> inverse transformation matrix of MRI -> MNI) for creating forward models for
> source-analysis for CTF data in fieldtrip.
>
> That works quite well, however, when trying to plot the results in fieldtrip
> I face the problem that the sources and the MRI (read into fieldtrip using
> read_mri and the SPM8 toolbox) have different coordinate systems.
>
> How can I recompute the coordinates of the MRI so that it is in fieldtrip
> (CTF-head-coordinates) format?
> I have the fiducial info from SPM available...
> Is it possible to do sth like:
>
> pos = mri.transform * mri.ind;
> pos = pos - fiducial.pos; %or whatever - do a translation to the origin of
> the 'new coordinate system'
> mri.transform = pos  / ind;
>
> ??
> or is it also necessary to flip the dimensions / specify further info??
> cause I think MRI's in SPM have the x- and y-axis flipped compared to the
> CTF/fieldtrip headmodel format...
>
> Any suggestions would be appreciated, thanks
> Markus
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
> EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From zaifengg at GMAIL.COM  Sat Apr 17 14:06:57 2010
From: zaifengg at GMAIL.COM (gao zai)
Date: Sat, 17 Apr 2010 15:06:57 +0300
Subject: Questions on sourceplot after sourcestatistics
Message-ID: <SAT.17.APR.2010.150657.0300.FIELDTRIP@NIC.SURFNET.NL>

Dear all,

I am writing to ask one question which appears very odd to me.

I finish the volumenarmalise, sourcestatistics and sourceinterpolate to a
MRI, but when I do the sourceplot using the following script, an error pops
out:

*Script:*
----------------
sMRI = read_mri(fullfile(spm('dir'), 'canonical', 'single_subj_T1.nii'));
cfg = [];
cfg.parameter = {'prob' 'mask'};
statplot = ft_sourceinterpolate(cfg, stat, sMRI);

cfg = [];
cfg.method        = 'ortho';
cfg.maskparameter = 'mask';
cfg.funparameter  = 'prob';
cfg.interactive   = 'yes';
figure
ft_sourceplot(cfg, statplot);
---------------------------------------------

*Error*
------------------
?? Error using ==> set
Bad property value found.
Object Name :  axes
Property Name : 'ALim'
Values must be increasing and non-NaN.

Error in ==> alim at 44
    set(ax,'alim',val);

Error in ==> sourceplot>plot2D at 1212
      alim(scales{3});

Error in ==> sourceplot at 754
    plot2D(vols2D, scales, doimage);

Error in ==> ft_sourceplot at 11
[varargout{1:nargout}] = funhandle(varargin{:});
--------------------------

However, if in the sourceplot, I just *unuse* cfg.maskparameter = 'mask';
then everything is fine.
I checked my script, it seems to me everything is fine. Does anybody know
what's problem with it or can give me some suggestion?
Thank you much in advance.

Best,
Feng

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100417/18c649b5/attachment.htm>

From m.bauer at UCL.AC.UK  Sat Apr 17 16:22:44 2010
From: m.bauer at UCL.AC.UK (Markus Bauer)
Date: Sat, 17 Apr 2010 15:22:44 +0100
Subject: manually specifying fiducial positions in MRI structure
In-Reply-To: <z2se1e7c57c1004170017pbe76d8f1vea0b4db777890bd9@mail.gmail.com>
Message-ID: <SAT.17.APR.2010.152244.0100.FIELDTRIP@NIC.SURFNET.NL>

Hi Vladimir

> When building the head model SPM generated some .gii files that should
> be at the same location where your individual MRIs were. If you load
> the one corresponding to the cortex with something like:
>
> m = export(gifti('filename.gii'), 'ft');
>
> you can take m.pnt and put it in the source structure instead of
> source.pos there.

thanks, I actually had used this structure to define the grid-positions
for the leadfields (in one approach)

grid.pos = forward.forward.mesh.vert;

obtained from the headmodel.
I had been struggling to interpolate this to an anatomical MRI but will
look more carefully into the link from Robert

http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space

that you kindly sent me.

Thanks a lot so far for your help!!

Markus

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From v.litvak at ION.UCL.AC.UK  Sat Apr 17 16:58:39 2010
From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak)
Date: Sat, 17 Apr 2010 15:58:39 +0100
Subject: manually specifying fiducial positions in MRI structure
In-Reply-To: <4BC9C434.8020209@ucl.ac.uk>
Message-ID: <SAT.17.APR.2010.155839.0100.FIELDTRIP@NIC.SURFNET.NL>

It's not the same that's the point, Markus. Try doing exactly as I say
and then see if it works.

Vladimir

On Sat, Apr 17, 2010 at 3:22 PM, Markus Bauer <m.bauer at ucl.ac.uk> wrote:
> Hi Vladimir
>
>> When building the head model SPM generated some .gii files that should
>> be at the same location where your individual MRIs were. If you load
>> the one corresponding to the cortex with something like:
>>
>> m = export(gifti('filename.gii'), 'ft');
>>
>> you can take m.pnt and put it in the source structure instead of
>> source.pos there.
>
> thanks, I actually had used this structure to define the grid-positions for
> the leadfields (in one approach)
>
> grid.pos = forward.forward.mesh.vert;
>
> obtained from the headmodel.
> I had been struggling to interpolate this to an anatomical MRI but will look
> more carefully into the link from Robert
>
> http://fieldtrip.fcdonders.nl/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space
>
> that you kindly sent me.
>
> Thanks a lot so far for your help!!
>
> Markus
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
> and EEG analysis. See also
> http://listserv.surfnet.nl/archives/fieldtrip.html and
> http://www.ru.nl/neuroimaging/fieldtrip.
>
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From g.piantoni at NIN.KNAW.NL  Mon Apr 19 11:35:42 2010
From: g.piantoni at NIN.KNAW.NL (Giovanni Piantoni)
Date: Mon, 19 Apr 2010 11:35:42 +0200
Subject: reading EGI data
In-Reply-To: <E4127CB9-40D2-4763-AC8F-3C0F2C431A82@mac.com>
Message-ID: <MON.19.APR.2010.113542.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Joseph,

Thanks for your quick reply, the fix works perfectly!

Much appreciated,

Gio

On Sat, Apr 17, 2010 at 08:58, Joseph Dien <jdien07 at mac.com> wrote:
> Try this as a replacement for the read_sbin_data.m file.  It fixes the
> problem (which, contrary to what I just said, is that the unsegmented data
> code someone added was assuming the files are always int16 whereas your data
> is single, so it wasn't skipping the correct number of bytes).  It's based
> on the fieldtrip-20100406 release rather than today's release but should be
> good enough until I can get the fix posted.  Let me know if there are any
> further problems.
> function [trialData] = read_sbin_data(filename, hdr, begtrial, endtrial,
> chanindx)
>
>
>
> % READ_SBIN_DATA reads the data from an EGI segmented simple binary format
> file
> %
> % Use as
> %   [trialData] = read_sbin_data(filename, hdr, begtrial, endtrial,
> chanindx)
> % with
> %   filename       name of the input file
> %   hdr            header structure, see READ_HEADER
> %   begtrial       first trial to read, mutually exclusive with
> begsample+endsample
> %   endtrial       last trial to read,  mutually exclusive with
> begsample+endsample
> %   chanindx       list with channel indices to read
> %
> % This function returns a 3-D matrix of size Nchans*Nsamples*Ntrials.
> %_______________________________________________________________________
> %
> %
> % Modified from EGI's readEGLY.m with permission 2008-03-31 Joseph Dien
> %
>
>
>
> % Subversion does not use the Log keyword, use 'svn log <filename>' or 'svn
> -v log | less' to get detailled information
>
>
>
> fh=fopen([filename],'r');
> if fh==-1
>   error('wrong filename')
> end
>
>
>
> version = fread(fh,1,'int32');
>
>
>
> %check byteorder
> [str,maxsize,cEndian]=computer;
> if version < 7
>   if cEndian == 'B'
>     endian = 'ieee-be';
>   elseif cEndian == 'L'
>     endian = 'ieee-le';
>   end;
> elseif (version > 6) && ~bitand(version,6)
>   if cEndian == 'B'
>     endian = 'ieee-le';
>   elseif cEndian == 'L'
>     endian = 'ieee-be';
>   end;
>   version = swapbytes(uint32(version)); %hdr.orig.header_array is already
> byte-swapped
> else
>     error('ERROR:  This is not a simple binary file.  Note that NetStation
> does not successfully directly convert EGIS files to simple binary
> format.\n');
> end;
>
>
>
> if bitand(version,1) == 0
>     unsegmented = 1;
> else
>     unsegmented = 0;
> end;
>
>
>
> precision = bitand(version,6);
> Nevents=hdr.orig.header_array(17);
>
>
>
> switch precision
>     case 2
>         trialLength=2*hdr.nSamples*(hdr.nChans+Nevents)+6;
>         dataType='int16';
>         dataLength=2;
>     case 4
>         trialLength=4*hdr.nSamples*(hdr.nChans+Nevents)+6;
>         dataType='single';
>         dataLength=4;
>     case 6
>         trialLength=8*hdr.nSamples*(hdr.nChans+Nevents)+6;
>         dataType='double';
>         dataLength=8;
> end
>
>
>
> if unsegmented
>     %interpret begtrial and endtrial as sample indices
>     fseek(fh, 36+Nevents*4, 'bof'); %skip over header
>     fseek(fh, ((begtrial-1)*(hdr.nChans+Nevents)*dataLength), 'cof'); %skip
> previous trials
>     nSamples  = endtrial-begtrial+1;
>     trialData = fread(fh, [hdr.nChans+Nevents, nSamples],dataType,endian);
> else
>     fseek(fh,
> 40+length(hdr.orig.CatLengths)+sum(hdr.orig.CatLengths)+Nevents*4, 'bof');
> %skip over header
>     fseek(fh, (begtrial-1)*trialLength, 'cof'); %skip over initial segments
>
>
>
>     trialData=zeros(hdr.nChans,hdr.nSamples,endtrial-begtrial+1);
>
>
>
>     for segment=1:(endtrial-begtrial+1)
>         fseek(fh, 6, 'cof'); %skip over segment info
>         temp = fread(fh, [(hdr.nChans+Nevents),
> hdr.nSamples],dataType,endian);
>         trialData(:,:,segment) = temp(1:hdr.nChans,:);
>     end
> end
> trialData=trialData(chanindx, :,:);
> fclose(fh);
>
>
>
> On Apr 17, 2010, at 2:41 AM, Joseph Dien wrote:
>
> Hi,
>    yeah, there's a bug in the code.  When someone added support for
> unsegmented files to my EGI simple binary file format code, it appears they
> didn't test it very well.  There's been a number of problems.  In this case,
> instead of just skipping the first sample, it's skipping hdr.nChans+Nevents
> samples, resulting in mangled data.
>
> I'm at a conference right now but as soon as I get home I'll post a fix and
> let you know that it's done.  Sigh...
>
> Joe
>
>
>
> On Apr 16, 2010, at 12:09 PM, Giovanni Piantoni wrote:
>
> Dear all,
>
> I get this incredible error when I try to read EGI data. If the first
>
> data point is odd, it works well (EGI_data_odd.png), while if the
>
> first data point is even, then the result doesn't make much sense
>
> (EGI_data_even.png).
>
> You can replicate it with this data:
>
> http://bit.ly/cdqzZH
>
> and the following code:
>
> cfg = [];
>
> cfg.dataset = 'EGIrecording.raw';
>
> cfg.trialdef.triallength = Inf;
>
> def = ft_definetrial(cfg);
>
> data = ft_preprocessing(def);
>
> plot(data.trial{1}(1,:)) % odd
>
> def.trl(1) = 2;
>
> data = ft_preprocessing(def);
>
> plot(data.trial{1}(1,:)) % even
>
> Does anybody have an idea on what's going on?
>
> Thanks,
>
> Gio
>
> -------------------------------------------------------------------------------------
>
> MATLAB Version 7.9.0.529 (R2009b)
>
> Operating System: Linux 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12
>
> 04:38:19 UTC 2010 x86_64
>
> Java VM Version: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java
>
> HotSpot(TM) 64-Bit Server VM mixed mode
>
> -------------------------------------------------------------------------------------
>
> --
>
> Giovanni Piantoni, Ph.D. student
>
> Dept. Sleep & Cognition
>
> Netherlands Institute for Neuroscience
>
> Meibergdreef 47
>
> 1105 BA Amsterdam (NL)
>
> +31 (0)20 5665492
>
> g.piantoni at nin.knaw.nl
>
> www.nin.knaw.nl/research_groups/van_someren_group/
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
> and EEG analysis. See also
> http://listserv.surfnet.nl/archives/fieldtrip.html and
> http://www.ru.nl/neuroimaging/fieldtrip.
>
> <EGI_data_odd.png><EGI_data_even.png>
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
> and EEG analysis. See also
> http://listserv.surfnet.nl/archives/fieldtrip.html and
> http://www.ru.nl/neuroimaging/fieldtrip.
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
> EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From m.bauer at UCL.AC.UK  Mon Apr 19 18:57:42 2010
From: m.bauer at UCL.AC.UK (Markus Bauer)
Date: Mon, 19 Apr 2010 17:57:42 +0100
Subject: manually specifying fiducial positions in MRI structure
In-Reply-To: <g2se1e7c57c1004170758m6a58be2bhe88cf724a4a44909@mail.gmail.com>
Message-ID: <MON.19.APR.2010.175742.0100.FIELDTRIP@NIC.SURFNET.NL>

> It's not the same that's the point, Markus. Try doing exactly as I say
> and then see if it works.
>

grid.pos = forward.forward.mesh.vert;

thx, but this (the upper) is correct for specifying the grid-points for
the leadfields - or is that wrong already?

m = export(gifti('filename.gii'), 'ft');

whereas this is in the analyse-voxel format  - and can thus be used for
overlaying source-results with individual anatomy ??

Markus

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From bibi.raquel at GMAIL.COM  Tue Apr 20 01:45:13 2010
From: bibi.raquel at GMAIL.COM (Raquel Bibi)
Date: Mon, 19 Apr 2010 19:45:13 -0400
Subject: ft_channelrepair
Message-ID: <MON.19.APR.2010.194513.0400.FIELDTRIP@NIC.SURFNET.NL>

When I interpolate my data on a trial by trial basis, occasionally the
ft_channelrepair replaces my data with NaNs.  Is this a bug?  I would also
love a good suggestion on how to select different channels ( I have a
routine that does selects bad channels well) but how can I construct an
array trial by trial for ft_channelrepair, the way I am doing it is very
cumbersome.

Thanks in advance for your help.

Best Regards,

Raquel

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100419/8a1b1d5b/attachment.htm>

From v.litvak at ION.UCL.AC.UK  Tue Apr 20 11:44:23 2010
From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak)
Date: Tue, 20 Apr 2010 10:44:23 +0100
Subject: manually specifying fiducial positions in MRI structure
In-Reply-To: <4BCC8B86.1000207@ucl.ac.uk>
Message-ID: <TUE.20.APR.2010.104423.0100.FIELDTRIP@NIC.SURFNET.NL>

Hi Markus,

I need to write a more detailed answer when I have time and then
things will hopefully become clear. But for now...

On Mon, Apr 19, 2010 at 5:57 PM, Markus Bauer <m.bauer at ucl.ac.uk> wrote:
>> It's not the same that's the point, Markus. Try doing exactly as I say
>> and then see if it works.
>>
>
> grid.pos = forward.forward.mesh.vert;
>
> thx, but this (the upper) is correct for specifying the grid-points for the
> leadfields - or is that wrong already?
>

This is correct because these points are in MEG head coordinates in mm
as are the vol and the grad in SPM.

> m = export(gifti('filename.gii'), 'ft');
>
> whereas this is in the analyse-voxel format  - and can thus be used for
> overlaying source-results with individual anatomy ??
>

.gii is not analyze but a GIFTI format which is a format for storing
meshes. What you get are the points of the same mesh but corresponding
to your individual MRI so you can use them for ft_sourceinterpolate.

Vladimir

> Markus
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG
> and EEG analysis. See also
> http://listserv.surfnet.nl/archives/fieldtrip.html and
> http://www.ru.nl/neuroimaging/fieldtrip.
>
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From tzvetan.popov at UNI-KONSTANZ.DE  Tue Apr 20 13:19:00 2010
From: tzvetan.popov at UNI-KONSTANZ.DE (Tzvetan Popov)
Date: Tue, 20 Apr 2010 13:19:00 +0200
Subject: regarding interaction calculation
Message-ID: <TUE.20.APR.2010.131900.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Users,

I have a question regarding calculation of interaction. One imagine 5
subjects observed in 3 experimental conditions. In this case to test
the differences between those three conditions, one would use
'depsamplesF'  with the following design matrix:

design = [1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
                   1 1 1 1 1 2 2 2 2 3 3 3 3 3 3]; , where uvar=1 and
ivar=2

Now if one imagine 2 sessions of the same 5 subjects and want to
calculate 2x3 ANOVA the design matrix may look like this;

design = [1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
                   1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2
2 2 2 2
                   1 1 1 1 1 2 2 2 2 3 3 3 3 3 3 1 1 1 1 1 2 2 2 2 3 3
3 3 3 3];, where uvar=1, ivar=3 and the second row represents the
group affiliation.

If this calculation is possible, which I am also not certain, my
question is, is the design matrix correct and what should be the cfg.
setting for the 'group affiliation' row?

Many many thanks
tzvetan



*******************************************
Tzvetan Popov
Clinical Psychology
University of Konstanz
Box 23
78457 Konstanz, GERMANY
Phone: 0049-7531-883086
Fax:      0049-7531-884601
Email:  tzvetan.popov at uni-konstanz.de
*******************************************

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From nathanweisz at MAC.COM  Tue Apr 20 13:41:32 2010
From: nathanweisz at MAC.COM (Nathan Weisz)
Date: Tue, 20 Apr 2010 13:41:32 +0200
Subject: regarding interaction calculation
In-Reply-To: <962868DF-5F55-4467-825B-A86534FE85AE@uni-konstanz.de>
Message-ID: <TUE.20.APR.2010.134132.0200.>

On 20.04.2010, at 13:19, Tzvetan Popov wrote:

> Dear Users,
>
> I have a question regarding calculation of interaction. One imagine 5 subjects observed in 3 experimental conditions. In this case to test the differences between those three conditions, one would use 'depsamplesF'  with the following design matrix:
>
> design = [1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
>                  1 1 1 1 1 2 2 2 2 3 3 3 3 3 3]; , where uvar=1 and ivar=2
>
> Now if one imagine 2 sessions of the same 5 subjects and want to calculate 2x3 ANOVA the design matrix may look like this;
>
> design = [1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
>                  1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
>                  1 1 1 1 1 2 2 2 2 3 3 3 3 3 3 1 1 1 1 1 2 2 2 2 3 3 3 3 3 3];, where uvar=1, ivar=3 and the second row represents the group affiliation.
>
> If this calculation is possible, which I am also not certain, my question is, is the design matrix correct and what should be the cfg. setting for the 'group affiliation' row?
>
> Many many thanks
> tzvetan
>
>
>
> *******************************************
> Tzvetan Popov
> Clinical Psychology
> University of Konstanz
> Box 23
> 78457 Konstanz, GERMANY
> Phone: 0049-7531-883086
> Fax:      0049-7531-884601
> Email:  tzvetan.popov at uni-konstanz.de
> *******************************************
>
> ----------------------------------
> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From maglione.antongiulio at LIBERO.IT  Tue Apr 20 16:09:28 2010
From: maglione.antongiulio at LIBERO.IT (maglione.antongiulio)
Date: Tue, 20 Apr 2010 16:09:28 +0200
Subject: Make vol structure (beamformer)
Message-ID: <TUE.20.APR.2010.160928.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Users,
i have realistic head model and i don't see an example as make vol
structure.
i found an example where show as create 3 sphere.
how to make vol structure to use its in ft_prepare_leadfield function?

thanks,
giulio




--
" Un giorno, passeggiando nella foresta, ho visto una bestia. Quando mi sono
avvicinato ho visto che era un uomo. Quando sono arrivato vicino a lui mi
sono accorto che era mio fratello" (Proverbio tibetano)
Vieni a trovarmi a quest'indirizzo:

angima.blogspot.com oppure
http://www.facebook.com/antongiulio.maglione?ref=name (Facebook)

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100420/61c4d162/attachment.htm>

From amrgermany at YAHOO.COM  Wed Apr 21 22:55:14 2010
From: amrgermany at YAHOO.COM (Amr Ayoub)
Date: Wed, 21 Apr 2010 20:55:14 +0000
Subject: ft_freqdescriptives - coherence calculation is lacking in the
 newest version
Message-ID: <WED.21.APR.2010.205514.0000.FIELDTRIP@NIC.SURFNET.NL>

Hello,

The old version of freqdescriptives computes the coherence but not in the newest version.
To replicate the code: Examples Matlab scripts - Cross Frequency analysis - phalow_amphigh
Line: coh=ft_freqdescriptives([],freq2);
coh structure contains only a powspctrm field but not cohspctrm.
I also tried cfg.cohmethod='coh' as configuration but was not successful.

Regards,
Amr Ayoub



----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100421/27acd6e9/attachment.htm>

From conrado.bosman at GMAIL.COM  Wed Apr 21 23:32:24 2010
From: conrado.bosman at GMAIL.COM (Conrado Bosman)
Date: Wed, 21 Apr 2010 23:32:24 +0200
Subject: ft_freqdescriptives - coherence calculation is lacking in the
 newest version
In-Reply-To: <312696.45625.qm@web23601.mail.ird.yahoo.com>
Message-ID: <WED.21.APR.2010.233224.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Amr,

The computation of coherence and other measurements of connectivity
are implemented in the new FieldTrip function denominated
ft_connectivityanalysis. PLease check the documentation reference for
further details

All the best,
Conrado

On Apr 21, 2010, at 10:55 PM, Amr Ayoub wrote:

> Hello,
>
> The old version of freqdescriptives computes the coherence but not
> in the newest version.
> To replicate the code: Examples Matlab scripts - Cross Frequency
> analysis - phalow_amphigh
> Line: coh=ft_freqdescriptives([],freq2);
> coh structure contains only a powspctrm field but not cohspctrm.
> I also tried cfg.cohmethod='coh' as configuration but was not
> successful.
>
> Regards,
> Amr Ayoub
>
>
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From brian.roach at YALE.EDU  Fri Apr 23 00:38:33 2010
From: brian.roach at YALE.EDU (Brian Roach)
Date: Thu, 22 Apr 2010 15:38:33 -0700
Subject: Post-doctoral training in the Neuroscience of Schizophrenia
Message-ID: <THU.22.APR.2010.153833.0700.FIELDTRIP@NIC.SURFNET.NL>

University of California San Francisco
Three post-doctoral fellowships in translational neuroscience of
schizophrenia.
Sponsor(s): NIMH
Application Date(s): Beginning April 1, 2010

The NIMH-funded T32 Training Grant (Neurobiological mechanisms
underlying the symptoms and course of schizophrenia) at the University
of California in San Francisco is now accepting applications for
post-doctoral fellowships from recent PhDs, MDs, and MD/PhDs.

Trainees will work in labs studying the neurobiological mechanisms of
the symptoms of schizophrenia and its neuro-developmental and
neuro-degenerative course. The core T32 faculty are basic
neuroscientists and psychiatrists, working in genetics, brain imaging,
electrophysiology, and neuroplasticity.  They are: Steve Batki, William
Byerley, Benjamin Cheyette, Allison Doupe, Judith Ford, Steven Hamilton,
Daniel Mathalon, John Rubenstein, Susan Voglmaier, Sophia Vinogradov,
and Mark von Zastrow.

T32 Trainees will have extended experience in a laboratory, leading to
the submission of research papers and grant proposals.  Trainees will be
dual-mentored with Research and Career Mentors to guide them both
formally and informally, through learning neurobiological methods,
producing a body of data, presenting data at national meetings, writing
and publishing papers, preparing grant proposals, and attending local
and national workshops on launching and maintaining successful careers
in biological psychiatry.

We seek applications from ethnically diverse scientists who have strong
academic credentials and US citizenship or permanent residence.  NIH
rules for T32 trainees state, "The individual to be trained must be a
citizen or a noncitizen national of the United States or have been
lawfully admitted for permanent residence by the time of award.
Individuals who have been lawfully admitted for permanent residence must
have a currently valid Alien Registration Receipt Card (I-551) or other
legal verification of such status."

Potential applicants are welcome to contact any of the core faculty
members. An application form is attached.  Additional information can be
found by visiting our website (http://psych.ucsf.edu/t32/neuro_scz).

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ford_T32_Application 7.doc
Type: application/msword
Size: 95232 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100422/d299a4b2/attachment.doc>

From r.oostenveld at FCDONDERS.RU.NL  Sun Apr 25 08:07:52 2010
From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld)
Date: Sun, 25 Apr 2010 08:07:52 +0200
Subject: Make vol structure (beamformer)
In-Reply-To: <x2pa490e1cd1004200709g8faf6426q9d23497588fddef5@mail.gmail.com>
Message-ID: <SUN.25.APR.2010.080752.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Guilio

You describe that you have a realistic description of the geometry. Depending on whether you want to use EEG or MEG, and depending on what kind of method for computing the volume conduction model you want to use, there are different functions that construct "vol", i.e. the volume  conduction model. 

I just started to work on improving the documentation for head modeling and am also planning on cleaning up and renaming the functions. Here is a short summary corresponding to the current implementation:

for EEG there are
  ft_prepare_bemmodel.m
  ft_prepare_concentricspheres.m

 and for MEG there are
  ft_prepare_localspheres.m
  ft_prepare_singleshell.m

Please look at the help of these functions. If that does not clarify it, please look at http://fieldtrip.fcdonders.nl/tutorial/headmodel (which is work in progress).

best regards,
Robert




On 20 Apr 2010, at 16:09, maglione.antongiulio wrote:

> Hi Users,
> i have realistic head model and i don't see an example as make vol structure.
> i found an example where show as create 3 sphere.
> how to make vol structure to use its in ft_prepare_leadfield function?
> 
> thanks,
> giulio
> 
> 
>  
> 
> -- 
> " Un giorno, passeggiando nella foresta, ho visto una bestia. Quando mi sono avvicinato ho visto che era un uomo. Quando sono arrivato vicino a lui mi sono accorto che era mio fratello" (Proverbio tibetano)
> Vieni a trovarmi a quest'indirizzo:
> 
> angima.blogspot.com oppure
> http://www.facebook.com/antongiulio.maglione?ref=name (Facebook)
> 
> 
> ----------------------------------
> 
> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.
> 
> http://listserv.surfnet.nl/archives/fieldtrip.html
> 
> http://www.ru.nl/fcdonders/fieldtrip/
> 


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100425/8da90467/attachment.htm>

From karl.doron at GMAIL.COM  Mon Apr 26 07:03:10 2010
From: karl.doron at GMAIL.COM (Karl Doron)
Date: Mon, 26 Apr 2010 07:03:10 +0200
Subject: log log for multiplotER
Message-ID: <MON.26.APR.2010.070310.0200.FIELDTRIP@NIC.SURFNET.NL>

Hello,

Is there a way to have multiplotER plot the loglog of the powerspectrum?

Thanks,
karl doron

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From grion at SISSA.IT  Mon Apr 26 16:35:25 2010
From: grion at SISSA.IT (Natalia Grion)
Date: Mon, 26 Apr 2010 16:35:25 +0200
Subject: 64-bit windows
Message-ID: <MON.26.APR.2010.163525.0200.FIELDTRIP@NIC.SURFNET.NL>

Hello all,
           I have a short general question: is there any reason for not
including in fieldtrip mexfiles for 64bit windows?
Thank you,
Natalia






----------------------------------------------------------------
  SISSA Webmail https://webmail.sissa.it/
  Powered by SquirrelMail http://www.squirrelmail.org/

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From s.klanke at DONDERS.RU.NL  Mon Apr 26 17:06:16 2010
From: s.klanke at DONDERS.RU.NL (Stefan Klanke)
Date: Mon, 26 Apr 2010 17:06:16 +0200
Subject: 64-bit windows
In-Reply-To: <52962.147.122.60.164.1272292525.squirrel@webmail.sissa.it>
Message-ID: <MON.26.APR.2010.170616.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Natalia,

> I have a short general question: is there any reason for not
> including in fieldtrip mexfiles for 64bit windows?

Yes, but it's just that we currently don't have a 64bit Windows machine
available at the Donders. Hopefully this will change soon, and then we
will pre-compile and package 64-bit mexfiles for Windows (7) as well.

For the time being, in case you have problems, I can try to help you
compile the files yourself if you let me know which compiler you have
installed, and which MEX files you need most urgently.

Cheers,
Stefan

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From v.litvak at ION.UCL.AC.UK  Tue Apr 27 13:32:49 2010
From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak)
Date: Tue, 27 Apr 2010 12:32:49 +0100
Subject: fiducials: head -> MRI ccordinates ?
In-Reply-To: <4BD5C4AA.8060905@ucl.ac.uk>
Message-ID: <TUE.27.APR.2010.123249.0100.FIELDTRIP@NIC.SURFNET.NL>

Hi Markus,

On Mon, Apr 26, 2010 at 5:51 PM, Markus Bauer <m.bauer at ucl.ac.uk> wrote:
> Are the fiducial positions after manual coregistration (using
> spm_eeg_inv_datareg_ui) stored anywhere in MRI-coordinates?
> I looked into the code and from what I see there, the manually entered
> fiducials (by clicking in the interactive window) are stored in the
> following field:
>
> forward.datareg.fid_mri.fid.pnt
>
>
> But that seems to be in (CTF ?) headcoordinates.
> I also found
>
> forward.mesh.fid.fid.pnt
>
>
> which seem to be the standard (MNI based) fiducial positions.
> I also found
>
> forward.datareg.fid_eeg.fid.pnt
>
>
> which could be the fiducials measured by the system, but I neither found the
> fiducials in MRI coordinates nor the transformation matrix to go from MRI to
> headcoordinates.
> Do you know where that is?


I'll try to give a detailed answer this time to explain the logic
behind the code. SPM needs to take into account 4 coordinate systems
that might or might not be different.

1) The coordinate system in which sensor locations were provided.
That's what you get from D.sensors and D.fiducials.
2) MNI coordinates corresponding to the template brain .
3) Native coordinates corresponding to the subject's structural. They
might be the same as MNI coordinates of the structural was
coregistered to the template, but might also be different.
4) The coordinate system in which MRI and sensors are coregistered. In
the case of EEG these are 'native coordinates' (3) and in the case of
MEG these are sensor coordinates (1). Usually for MEG these are so
called head coordinates, but they are defined in different way for
different MEG systems.

The reason for the difference between EEG and MEG is that for EEG the
coordinate system where sensor locations are measured is usually not
very meaningful so it is convenient to express everything in
MRI-linked coordinates. In MEG, however, it is convenient to use head
coordinates because then the same coregistration can be used for
different runs  (the location of the head in head coordinates is fixed
and only the sensor locations change).

Now, the canonical meshes that can be found in the .gii files under
spm/canonical are in MNI coordinates. There is also a set of standard
fiducials defined in MNI coordinates on the template brain. When you
use individual structural, nonlinear transformation is computed from
the template image to your individual image. The meshes and the
standard fiducials are then warped to correspond to the individual
image. These new meshes are stored in gii files in the directory where
that structural is. The names of these files appear in
D.inv{...}.mesh. There is also a copy of the unwarped canonical mesh
stored there (mesh.tess_mni). This is useful for producing output when
you move your datasets with inversions somewhere where the links to
individual meshes no longer work. Under D.inv{...}.mesh.fid you can
find the standard fiducials transformed to the 'native' coordinates.
If you use the template rather than individual image, these fiducials
will be in MNI coordinates. Under D.inv{...}.mesh.Affine you can find
a transformation matrix from native to MNI coordinates. Note that this
is just approximation to the nonlinear transform that is actually
applied to the meshes.

Now, when you do coregistration you define some corresponding points
in the native coordinates to at least 3 fiducials from those available
in sensor coordinates. These are used to compute the transformation
matrix between sensor and native coordinates (called M1 in the code of
spm_eeg_inv_datareg_ui). In the MEG case everything is then stored in
sensor coordinates, including the MRI fiducials. The function also
computes transformation matrices between the coregistration
coordinates (head coordinates) and MNI coordinates, since these are
the most useful to know in practice. If you look at lines 174-175 in
the latest version, you'll see:

D.inv{val}.datareg(ind).toMNI = D.inv{val}.mesh.Affine*M1;
D.inv{val}.datareg(ind).fromMNI = inv(D.inv{val}.datareg(ind).toMNI);


Now I can finally answer your question. You have MRI fiducials in head
coordinates stored under D.inv{...}.datareg.fid_mri . You can use the
function forwinv_transform_headshape (in the latest in-house SPM it's
called ft_transform_headshape) to transform these fiducials to another
coordinate system. All you need to provide is a 4x4 transformation
matrix. All you need for that is also provided. To go from head to MNI
coordinates you can use D.inv{...}.datareg.toMNI . To go to native
coordinates you can use
inv(D.inv{...}.mesh.Affine)*D.inv{...}.datareg.toMNI. So let's say
that you have a unimodal MEG dataset with a single inversion and want
to get MRI fiducials in MNI coordinates. Then you do:

mnifid = ft_transform_headshape(D.inv{1}.datareg.toMNI,
D.inv{1}.datareg.fid_mri );


I hope that was clear. If not, keep asking.

Best,

Vladimir

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From Nina.Kahlbrock at UNI-DUESSELDORF.DE  Tue Apr 27 14:23:31 2010
From: Nina.Kahlbrock at UNI-DUESSELDORF.DE (Nina)
Date: Tue, 27 Apr 2010 14:23:31 +0200
Subject: TFRs on virtual source data, Neuromag 122
In-Reply-To: <l2je1e7c57c1004270432x9b3606c6j76340af9f99f9610@mail.gmail.com>
Message-ID: <TUE.27.APR.2010.142331.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi all,



I am working on constructing a virtual sensor for my 122 Neuromag MEG data
in order to compute time frequency analysis on this virtual sensor.

The results I am getting so far are not in line with the sensor level data.
On sensor level I see a very clear gamma response. It is also present on
source level in the frequency domain, using dics, however, the time course
of the source is not as strong and frequency confined on source level. Does
anybody have any ideas on what I might be doing wrong?

In the following, I would like to explain what I have done so far and what
my problems are. I am attaching the script I used in text format.



About the data set:

It contains trials of three different conditions. These trials are of
variable lengths (spread evenly over the conditions) and there are not
always the same number of trials in each condition.



What I have done so far:

1.	based on TFRs on sensor level I chose each subject's strongest gamma
frequency
2.	for each subject, I took this frequency (+/- 5 Hz) and calculated
spatial filters for stimulation and baseline periods, averaged over all
three conditions using a DICS beamformer
3.	for each voxel, the ratio of poststimulus power to prestimulus power
was computed
4.	from that I took the voxel with maximum power increase and used it
as my voxel of interest,
5.	for this voxel of interest I calculated a new dipole grid with only
one voxel. It is in the same location as the strongest voxel from step 3.
6.	then I went back to my functional data and used the FT function
'timelockanalysis' to compute the covariance matrices for all my sensors and
trials (keeping single trials), trying different time windows for covariance
computation, but always calculating power for the whole time period:

a.	pre stimulus [-2 0] (but using the  whole trial for
timelockanalysis; time = [-2 3],
b.	post stimulus [0 3] (but using the  whole trial for
timelockanalysis; time = [-2 3],
c.	the whole time period [-2 3],
d.	pre stimulus [-2 0] (using only that time window for
timelockanalysis; time = [-2 0],
e.	post stimulus [0 2] (using only that time window for
timelockanalysis; time = [0 2]

7.	the covariance matrices were put into source analysis, again
computing spatial filters for the voxel of interest (using rawtrial = 'yes')
8.	NaNs, that were due to different lengths of trials, in dipole
moments resulting from source analysis were removed
9.	then I put the resulting dipole moments of the three directions
(x,y,z) into a structure that resembles that of preprocessed data
10.	time frequency representations of power were calculated using a
multitaper approach
11.	When looking at the three directions (x,y,z,) separately in a time
frequency plot, this gives me

a.	somehow meaningful results for the covariance window being pre
stimulus (5.a), however, they are a lot weaker than on sensor level.
b.	no meaningful results for the covariance window being post stimulus
(5.b) or the whole time period (5.c)

12.	for 5. d/e relative changes to baseline were calculated for each of
the trials

a.	this gives me somehow meaningful results, but very weak and not
constrained to the before found frequency ranges



Does anybody have experience with this kind of analysis? Do you have any
suggestions about which step might be causing these troubles?



Thank you all in advance for any help!



Nina




----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100427/e32d5897/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: virtualsensor.txt
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100427/e32d5897/attachment.txt>

From m.bauer at UCL.AC.UK  Tue Apr 27 15:36:39 2010
From: m.bauer at UCL.AC.UK (Markus Bauer)
Date: Tue, 27 Apr 2010 14:36:39 +0100
Subject: fiducials: head -> MRI ccordinates ?
In-Reply-To: <l2je1e7c57c1004270432x9b3606c6j76340af9f99f9610@mail.gmail.com>
Message-ID: <TUE.27.APR.2010.143639.0100.FIELDTRIP@NIC.SURFNET.NL>

Hi Vladimir

thanks a lot for your elaborated and detailed response...

to quickly summarize and check that I have understood you correctly:

forward.datareg.fid_mri.fid.pnt -

"sensor coordinate" based positions of the fiducials.
'sensor based' meaning here that they are in the same coordinate system
as the D.sensors (or in fieldtrip the 'grad' definition) - but does not
(necessarily) mean that they are "locked" to the actual sensor
positions. those can vary between datasets (esp for MEG)

D.inv{...}.mesh.Affine -

is the transformation matrix between the coordinate system inherent to
the individual MRI (i.e usually the analyze file *.hdr/*.img) and the MNI

the transformation matrix (in the code represented by 'M1') that rotates
the 'sensor-based' (in the case of CTF: head-based) coordinate system
onto the native individual's MRI (as in the analyze file) - is not
directly stored but can be obtained by:

inv(D.inv{val}.mesh.Affine) * D.inv{val}.datareg(ind).toMNI


Thanks a lot again. I guess that should be correct and seems quite clear.
Markus



> Hi Markus,
>
> On Mon, Apr 26, 2010 at 5:51 PM, Markus Bauer<m.bauer at ucl.ac.uk>  wrote:
>
>> Are the fiducial positions after manual coregistration (using
>> spm_eeg_inv_datareg_ui) stored anywhere in MRI-coordinates?
>> I looked into the code and from what I see there, the manually entered
>> fiducials (by clicking in the interactive window) are stored in the
>> following field:
>>
>> forward.datareg.fid_mri.fid.pnt
>>
>>
>> But that seems to be in (CTF ?) headcoordinates.
>> I also found
>>
>> forward.mesh.fid.fid.pnt
>>
>>
>> which seem to be the standard (MNI based) fiducial positions.
>> I also found
>>
>> forward.datareg.fid_eeg.fid.pnt
>>
>>
>> which could be the fiducials measured by the system, but I neither found the
>> fiducials in MRI coordinates nor the transformation matrix to go from MRI to
>> headcoordinates.
>> Do you know where that is?
>>
>
> I'll try to give a detailed answer this time to explain the logic
> behind the code. SPM needs to take into account 4 coordinate systems
> that might or might not be different.
>
> 1) The coordinate system in which sensor locations were provided.
> That's what you get from D.sensors and D.fiducials.
> 2) MNI coordinates corresponding to the template brain .
> 3) Native coordinates corresponding to the subject's structural. They
> might be the same as MNI coordinates of the structural was
> coregistered to the template, but might also be different.
> 4) The coordinate system in which MRI and sensors are coregistered. In
> the case of EEG these are 'native coordinates' (3) and in the case of
> MEG these are sensor coordinates (1). Usually for MEG these are so
> called head coordinates, but they are defined in different way for
> different MEG systems.
>
> The reason for the difference between EEG and MEG is that for EEG the
> coordinate system where sensor locations are measured is usually not
> very meaningful so it is convenient to express everything in
> MRI-linked coordinates. In MEG, however, it is convenient to use head
> coordinates because then the same coregistration can be used for
> different runs  (the location of the head in head coordinates is fixed
> and only the sensor locations change).
>
> Now, the canonical meshes that can be found in the .gii files under
> spm/canonical are in MNI coordinates. There is also a set of standard
> fiducials defined in MNI coordinates on the template brain. When you
> use individual structural, nonlinear transformation is computed from
> the template image to your individual image. The meshes and the
> standard fiducials are then warped to correspond to the individual
> image. These new meshes are stored in gii files in the directory where
> that structural is. The names of these files appear in
> D.inv{...}.mesh. There is also a copy of the unwarped canonical mesh
> stored there (mesh.tess_mni). This is useful for producing output when
> you move your datasets with inversions somewhere where the links to
> individual meshes no longer work. Under D.inv{...}.mesh.fid you can
> find the standard fiducials transformed to the 'native' coordinates.
> If you use the template rather than individual image, these fiducials
> will be in MNI coordinates. Under D.inv{...}.mesh.Affine you can find
> a transformation matrix from native to MNI coordinates. Note that this
> is just approximation to the nonlinear transform that is actually
> applied to the meshes.
>
> Now, when you do coregistration you define some corresponding points
> in the native coordinates to at least 3 fiducials from those available
> in sensor coordinates. These are used to compute the transformation
> matrix between sensor and native coordinates (called M1 in the code of
> spm_eeg_inv_datareg_ui). In the MEG case everything is then stored in
> sensor coordinates, including the MRI fiducials. The function also
> computes transformation matrices between the coregistration
> coordinates (head coordinates) and MNI coordinates, since these are
> the most useful to know in practice. If you look at lines 174-175 in
> the latest version, you'll see:
>
> D.inv{val}.datareg(ind).toMNI = D.inv{val}.mesh.Affine*M1;
> D.inv{val}.datareg(ind).fromMNI = inv(D.inv{val}.datareg(ind).toMNI);
>
>
> Now I can finally answer your question. You have MRI fiducials in head
> coordinates stored under D.inv{...}.datareg.fid_mri . You can use the
> function forwinv_transform_headshape (in the latest in-house SPM it's
> called ft_transform_headshape) to transform these fiducials to another
> coordinate system. All you need to provide is a 4x4 transformation
> matrix. All you need for that is also provided. To go from head to MNI
> coordinates you can use D.inv{...}.datareg.toMNI . To go to native
> coordinates you can use
> inv(D.inv{...}.mesh.Affine)*D.inv{...}.datareg.toMNI. So let's say
> that you have a unimodal MEG dataset with a single inversion and want
> to get MRI fiducials in MNI coordinates. Then you do:
>
> mnifid = ft_transform_headshape(D.inv{1}.datareg.toMNI,
> D.inv{1}.datareg.fid_mri );
>
>
> I hope that was clear. If not, keep asking.
>
> Best,
>
> Vladimir
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From nathanweisz at MAC.COM  Tue Apr 27 15:40:56 2010
From: nathanweisz at MAC.COM (Nathan Weisz)
Date: Tue, 27 Apr 2010 15:40:56 +0200
Subject: TFRs on virtual source data, Neuromag 122
In-Reply-To: <001d01cae604$730deab0$cd136386@VMED.UKD>
Message-ID: <TUE.27.APR.2010.154056.0200.>

hi nina,

did you validate the position by plotting them on the individuals MRI?
I mean the ones you define in xgrid, ygrid and zgrid.

when i project my data into source space to do e.g. time-frequencystuff i do:
cfg=[];
cfg.vol=vol;
cfg.grid.pos=rois; %%here is a difference to your code
cfg.grad=data.grad;
cfg.channel={'MEG'};

grid=prepare_leadfield(cfg);

then i continue with the sourceanalysis stuff.

good luck,
n

On 27.04.2010, at 14:23, Nina wrote:

> Hi all,
> 
>  
> 
> I am working on constructing a virtual sensor for my 122 Neuromag MEG data in order to compute time frequency analysis on this virtual sensor.
> 
> The results I am getting so far are not in line with the sensor level data. On sensor level I see a very clear gamma response. It is also present on source level in the frequency domain, using dics, however, the time course of the source is not as strong and frequency confined on source level. Does anybody have any ideas on what I might be doing wrong?
> 
> In the following, I would like to explain what I have done so far and what my problems are. I am attaching the script I used in text format.
> 
>  
> 
> About the data set:
> 
> It contains trials of three different conditions. These trials are of variable lengths (spread evenly over the conditions) and there are not always the same number of trials in each condition.
> 
>  
> 
> What I have done so far:
> 
> based on TFRs on sensor level I chose each subject’s strongest gamma frequency
> for each subject, I took this frequency (+/- 5 Hz) and calculated spatial filters for stimulation and baseline periods, averaged over all three conditions using a DICS beamformer
> for each voxel, the ratio of poststimulus power to prestimulus power was computed
> from that I took the voxel with maximum power increase and used it as my voxel of interest,
> for this voxel of interest I calculated a new dipole grid with only one voxel. It is in the same location as the strongest voxel from step 3.
> then I went back to my functional data and used the FT function ‘timelockanalysis’ to compute the covariance matrices for all my sensors and trials (keeping single trials), trying different time windows for covariance computation, but always calculating power for the whole time period:
> pre stimulus [-2 0] (but using the  whole trial for timelockanalysis; time = [-2 3],
> post stimulus [0 3] (but using the  whole trial for timelockanalysis; time = [-2 3],
> the whole time period [-2 3],
> pre stimulus [-2 0] (using only that time window for timelockanalysis; time = [-2 0],
> post stimulus [0 2] (using only that time window for timelockanalysis; time = [0 2]
> the covariance matrices were put into source analysis, again computing spatial filters for the voxel of interest (using rawtrial = ‘yes’)
> NaNs, that were due to different lengths of trials, in dipole moments resulting from source analysis were removed
> then I put the resulting dipole moments of the three directions (x,y,z) into a structure that resembles that of preprocessed data
> time frequency representations of power were calculated using a multitaper approach
> When looking at the three directions (x,y,z,) separately in a time frequency plot, this gives me
> somehow meaningful results for the covariance window being pre stimulus (5.a), however, they are a lot weaker than on sensor level.
> no meaningful results for the covariance window being post stimulus (5.b) or the whole time period (5.c)
> for 5. d/e relative changes to baseline were calculated for each of the trials
> this gives me somehow meaningful results, but very weak and not constrained to the before found frequency ranges
>  
> 
> Does anybody have experience with this kind of analysis? Do you have any suggestions about which step might be causing these troubles?
> 
>  
> 
> Thank you all in advance for any help!
> 
>  
> 
> Nina
> 
>  
> 
> ----------------------------------
> 
> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.
> 
> http://listserv.surfnet.nl/archives/fieldtrip.html
> 
> http://www.ru.nl/fcdonders/fieldtrip/
> 
> <virtualsensor.txt>


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100427/96e32d85/attachment.htm>

From suforraxi at GMAIL.COM  Tue Apr 27 16:21:08 2010
From: suforraxi at GMAIL.COM (Matteo Demuru)
Date: Tue, 27 Apr 2010 16:21:08 +0200
Subject: Non parametric test on coherence
Message-ID: <TUE.27.APR.2010.162108.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear all,

I have a problem using freqstatistics to calculate significance for
coherence.

Specifically I have a subject and I am performing a within-trials experiment
using 'indepsamplesZcoh' as statistic.

I calculate the TFR of my data with the cfg.output='powandcsd' and
cfg.keeptrials='yes' parameters. Then I call freqstatistics to compare my
different experimental conditions (baseline vs activation).

The function crashes with this output:

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

Error in ==> statfun_indepsamplesZcoh at 76
  nchan = length(cfg.label);

I have tried to add this field to the cfg struct assigning the cell that
contains the interested channels. However this time I have another error:

??? Error using ==> reshape
To RESHAPE the number of elements must not change.

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


Any suggestions?

Thanks in advance

Matteo Demuru

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100427/cac5763a/attachment.htm>

From karl.doron at GMAIL.COM  Tue Apr 27 23:05:35 2010
From: karl.doron at GMAIL.COM (Karl Doron)
Date: Tue, 27 Apr 2010 23:05:35 +0200
Subject: Error in ft_megrealign
Message-ID: <TUE.27.APR.2010.230535.0200.FIELDTRIP@NIC.SURFNET.NL>

Hello,

I'm getting the following error in megrealign: 

??? Maximum recursion limit of 642 reached. Use set(0,'RecursionLimit',N)
to change the limit.  Be aware that exceeding your available stack space can
crash MATLAB and/or your computer.

Error in ==> meg_leadfield1

Changing the recursion limit does indeed crash matlab. I'm running Matlab
7.9.0 (R2009b) on OSX 10.6.3, Mac Pro with 16Gb of RAM. I don't have the
matlab compiler so I commented out sections of the ft_megrealign.m file that
try to compile on the fly. I'm not sure if it needs to be compiled for the
64 bit version.

Thanks for any help,
karl doron

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.


From e.maris at DONDERS.RU.NL  Wed Apr 28 09:17:25 2010
From: e.maris at DONDERS.RU.NL (Eric Maris)
Date: Wed, 28 Apr 2010 09:17:25 +0200
Subject: Non parametric test on coherence
In-Reply-To: <o2k8a8bfe381004270721l747249f4of2fa0b9e8b81dc71@mail.gmail.com>
Message-ID: <WED.28.APR.2010.091725.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Matteo,





The statfun indepsamplesZcoh can only be used in a between-trials
experiment. You could cut out your baseline and activation segments
separately and then compare them in a non-paired fashion.





Best,



Eric















From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Matteo Demuru
Sent: dinsdag 27 april 2010 16:21
To: FIELDTRIP at NIC.SURFNET.NL
Subject: [FIELDTRIP] Non parametric test on coherence



Dear all,



I have a problem using freqstatistics to calculate significance for
coherence.



Specifically I have a subject and I am performing a within-trials experiment
using 'indepsamplesZcoh' as statistic.



I calculate the TFR of my data with the cfg.output='powandcsd' and
cfg.keeptrials='yes' parameters. Then I call freqstatistics to compare my
different experimental conditions (baseline vs activation).



The function crashes with this output:



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



Error in ==> statfun_indepsamplesZcoh at 76

  nchan = length(cfg.label);



I have tried to add this field to the cfg struct assigning the cell that
contains the interested channels. However this time I have another error:



??? Error using ==> reshape

To RESHAPE the number of elements must not change.



Error in ==> clusterstat at 178

      posclusobs = findcluster(reshape(postailobs,
[cfg.dim,1]),channeighbstructmat,cfg.minnbchan);





Any suggestions?



Thanks in advance



Matteo Demuru



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100428/ba5a63fb/attachment.htm>

From suforraxi at GMAIL.COM  Wed Apr 28 13:57:01 2010
From: suforraxi at GMAIL.COM (Matteo Demuru)
Date: Wed, 28 Apr 2010 13:57:01 +0200
Subject: Non parametric test on coherence
In-Reply-To: <8767631097936208134@unknownmsgid>
Message-ID: <WED.28.APR.2010.135701.0200.FIELDTRIP@NIC.SURFNET.NL>

Dear Eric,

I have tried the between-trials experiment too, but the two problems still
remain (the statfun_indepsamplesZcoh looks for label field. Furtheremore if
I add it the reshape function crashes). Any other suggestions?

I have also another question relative to your reply: the baseline and
activation trials were already divided in the within-trials experiment, the
only difference with the between-trials experiment are relative to the
configuration parameters (i.e.  in between-trials only cfg.ivar is set while
in within-trials cfg.ivar and cfg.uvar are set) am I wrong?

Regarding the 'label field' problem, it seems a required field for the
configuration struct because it is used in statfun_indepsamplesZcoh to
calculate the channel combinations for the coherence.

Thanks a lot

Matteo



On Wed, Apr 28, 2010 at 9:17 AM, Eric Maris <e.maris at donders.ru.nl> wrote:

>  Dear Matteo,
>
>
>
>
>
> The statfun indepsamplesZcoh can only be used in a between-trials
> experiment. You could cut out your baseline and activation segments
> separately and then compare them in a non-paired fashion.
>
>
>
>
>
> Best,
>
>
>
> Eric
>
>
>
>
>
> *From:* FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] *On
> Behalf Of *Matteo Demuru
> *Sent:* dinsdag 27 april 2010 16:21
> *To:* FIELDTRIP at NIC.SURFNET.NL
> *Subject:* [FIELDTRIP] Non parametric test on coherence
>
>
>
> Dear all,
>
>
>
> I have a problem using freqstatistics to calculate significance for
> coherence.
>
>
>
> Specifically I have a subject and I am performing a within-trials
> experiment using 'indepsamplesZcoh' as statistic.
>
>
>
> I calculate the TFR of my data with the cfg.output='powandcsd' and
> cfg.keeptrials='yes' parameters. Then I call freqstatistics to compare my
> different experimental conditions (baseline vs activation).
>
>
>
> The function crashes with this output:
>
>
>
> ??? Reference to non-existent field 'label'.
>
>
>
> Error in ==> statfun_indepsamplesZcoh at 76
>
>   nchan = length(cfg.label);
>
>
>
> I have tried to add this field to the cfg struct assigning the cell that
> contains the interested channels. However this time I have another error:
>
>
>
> ??? Error using ==> reshape
>
> To RESHAPE the number of elements must not change.
>
>
>
> Error in ==> clusterstat at 178
>
>       posclusobs = findcluster(reshape(postailobs,
> [cfg.dim,1]),channeighbstructmat,cfg.minnbchan);
>
>
>
>
>
> Any suggestions?
>
>
>
> Thanks in advance
>
>
>
> Matteo Demuru
>
>
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
> EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users of the
> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
> EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/
>

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100428/2ed48f06/attachment.htm>

From jan.schoffelen at DONDERS.RU.NL  Wed Apr 28 14:04:37 2010
From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen)
Date: Wed, 28 Apr 2010 14:04:37 +0200
Subject: Non parametric test on coherence
In-Reply-To: <p2h8a8bfe381004280457wf6ce8122vf43b0c3c4cbb8056@mail.gmail.com>
Message-ID: <WED.28.APR.2010.140437.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Matteo,

As far as I know, the indepsamplesZcoh only works properly if you
compute your TFR using ft_freqanalysis with cfg.output = 'fourier'.
Note that the output of the statistics-function probably gives
differential coherence spectra between all pairs of channels. The
clustering will in this case not work, because the spatial channel
neighbourhood structure supported to my knowledge only works with
univariate test-statistics. This means that you shouldn't specify
cfg.correctm = 'cluster'.

Cheers,

Jan-Mathijs

On Apr 28, 2010, at 1:57 PM, Matteo Demuru wrote:

> Dear Eric,
>
> I have tried the between-trials experiment too, but the two problems
> still remain (the statfun_indepsamplesZcoh looks for label field.
> Furtheremore if I add it the reshape function crashes). Any other
> suggestions?
>
> I have also another question relative to your reply: the baseline
> and activation trials were already divided in the within-trials
> experiment, the only difference with the between-trials experiment
> are relative to the configuration parameters (i.e.  in between-
> trials only cfg.ivar is set while in within-trials cfg.ivar and
> cfg.uvar are set) am I wrong?
>
> Regarding the 'label field' problem, it seems a required field for
> the configuration struct because it is used in
> statfun_indepsamplesZcoh to calculate the channel combinations for
> the coherence.
>
> Thanks a lot
>
> Matteo
>
>
>
> On Wed, Apr 28, 2010 at 9:17 AM, Eric Maris <e.maris at donders.ru.nl>
> wrote:
> Dear Matteo,
>
>
>
> The statfun indepsamplesZcoh can only be used in a between-trials
> experiment. You could cut out your baseline and activation segments
> separately and then compare them in a non-paired fashion.
>
>
>
> Best,
>
>
> Eric
>
>
>
> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On
> Behalf Of Matteo Demuru
> Sent: dinsdag 27 april 2010 16:21
> To: FIELDTRIP at NIC.SURFNET.NL
> Subject: [FIELDTRIP] Non parametric test on coherence
>
>
> Dear all,
>
>
> I have a problem using freqstatistics to calculate significance for
> coherence.
>
>
> Specifically I have a subject and I am performing a within-trials
> experiment using 'indepsamplesZcoh' as statistic.
>
>
> I calculate the TFR of my data with the cfg.output='powandcsd' and
> cfg.keeptrials='yes' parameters. Then I call freqstatistics to
> compare my different experimental conditions (baseline vs activation).
>
>
> The function crashes with this output:
>
>
> ??? Reference to non-existent field 'label'.
>
>
> Error in ==> statfun_indepsamplesZcoh at 76
>
>   nchan = length(cfg.label);
>
>
> I have tried to add this field to the cfg struct assigning the cell
> that contains the interested channels. However this time I have
> another error:
>
>
> ??? Error using ==> reshape
>
> To RESHAPE the number of elements must not change.
>
>
> Error in ==> clusterstat at 178
>
>       posclusobs = findcluster(reshape(postailobs, [cfg.dim,
> 1]),channeighbstructmat,cfg.minnbchan);
>
>
>
> Any suggestions?
>
>
> Thanks in advance
>
>
> Matteo Demuru
>
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/
>
>
> ----------------------------------
>
> The aim of this list is to facilitate the discussion between users
> of the FieldTrip toolbox, to share experiences and to discuss new
> ideas for MEG and EEG analysis.
>
> http://listserv.surfnet.nl/archives/fieldtrip.html
>
> http://www.ru.nl/fcdonders/fieldtrip/
>

Dr. J.M. (Jan-Mathijs) Schoffelen
Donders Institute for Brain, Cognition and Behaviour,
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands
J.Schoffelen at donders.ru.nl
Telephone: 0031-24-3668063


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100428/2d911a6b/attachment.htm>

From Nina.Kahlbrock at UNI-DUESSELDORF.DE  Wed Apr 28 15:05:40 2010
From: Nina.Kahlbrock at UNI-DUESSELDORF.DE (Nina)
Date: Wed, 28 Apr 2010 15:05:40 +0200
Subject: AW: [FIELDTRIP] TFRs on virtual source data, Neuromag 122
In-Reply-To: <B757B2DD-221B-41BF-AAF5-2049E450AE24@mac.com>
Message-ID: <WED.28.APR.2010.150540.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Nathan,



thank you very much for your response!

Performing source analysis on data not normalized to the template brain now
gives me reasonable results. I will however, try to figure out, what I was
doing wrong with the normalized data (even though plotting of my virtual
grid looked fine there, too).



Thanks again!



Nina





  _____

Von: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] Im Auftrag
von Nathan Weisz
Gesendet: Dienstag, 27. April 2010 15:41
An: FIELDTRIP at NIC.SURFNET.NL
Betreff: Re: [FIELDTRIP] TFRs on virtual source data, Neuromag 122



hi nina,



did you validate the position by plotting them on the individuals MRI?

I mean the ones you define in xgrid, ygrid and zgrid.



when i project my data into source space to do e.g. time-frequencystuff i
do:

cfg=[];

cfg.vol=vol;

cfg.grid.pos=rois; %%here is a difference to your code

cfg.grad=data.grad;

cfg.channel={'MEG'};



grid=prepare_leadfield(cfg);



then i continue with the sourceanalysis stuff.



good luck,

n



On 27.04.2010, at 14:23, Nina wrote:





Hi all,



I am working on constructing a virtual sensor for my 122 Neuromag MEG data
in order to compute time frequency analysis on this virtual sensor.

The results I am getting so far are not in line with the sensor level data.
On sensor level I see a very clear gamma response. It is also present on
source level in the frequency domain, using dics, however, the time course
of the source is not as strong and frequency confined on source level. Does
anybody have any ideas on what I might be doing wrong?

In the following, I would like to explain what I have done so far and what
my problems are. I am attaching the script I used in text format.



About the data set:

It contains trials of three different conditions. These trials are of
variable lengths (spread evenly over the conditions) and there are not
always the same number of trials in each condition.



What I have done so far:

1.	based on TFRs on sensor level I chose each subject's strongest gamma
frequency
2.	for each subject, I took this frequency (+/- 5 Hz) and calculated
spatial filters for stimulation and baseline periods, averaged over all
three conditions using a DICS beamformer
3.	for each voxel, the ratio of poststimulus power to prestimulus power
was computed
4.	from that I took the voxel with maximum power increase and used it
as my voxel of interest,
5.	for this voxel of interest I calculated a new dipole grid with only
one voxel. It is in the same location as the strongest voxel from step 3.
6.	then I went back to my functional data and used the FT function
'timelockanalysis' to compute the covariance matrices for all my sensors and
trials (keeping single trials), trying different time windows for covariance
computation, but always calculating power for the whole time period:

a.	pre stimulus [-2 0] (but using the  whole trial for
timelockanalysis; time = [-2 3],
b.	post stimulus [0 3] (but using the  whole trial for
timelockanalysis; time = [-2 3],
c.	the whole time period [-2 3],
d.	pre stimulus [-2 0] (using only that time window for
timelockanalysis; time = [-2 0],
e.	post stimulus [0 2] (using only that time window for
timelockanalysis; time = [0 2]

7.	the covariance matrices were put into source analysis, again
computing spatial filters for the voxel of interest (using rawtrial = 'yes')
8.	NaNs, that were due to different lengths of trials, in dipole
moments resulting from source analysis were removed
9.	then I put the resulting dipole moments of the three directions
(x,y,z) into a structure that resembles that of preprocessed data
10.	time frequency representations of power were calculated using a
multitaper approach
11.	When looking at the three directions (x,y,z,) separately in a time
frequency plot, this gives me

a.	somehow meaningful results for the covariance window being pre
stimulus (5.a), however, they are a lot weaker than on sensor level.
b.	no meaningful results for the covariance window being post stimulus
(5.b) or the whole time period (5.c)

12.	for 5. d/e relative changes to baseline were calculated for each of
the trials

a.	this gives me somehow meaningful results, but very weak and not
constrained to the before found frequency ranges



Does anybody have experience with this kind of analysis? Do you have any
suggestions about which step might be causing these troubles?



Thank you all in advance for any help!



Nina



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

<virtualsensor.txt>



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100428/7e87b7f8/attachment.htm>

From e.maris at DONDERS.RU.NL  Wed Apr 28 23:50:29 2010
From: e.maris at DONDERS.RU.NL (Eric Maris)
Date: Wed, 28 Apr 2010 23:50:29 +0200
Subject: Non parametric test on coherence
In-Reply-To: <D93670E3-52AB-476D-B274-E57348A03001@donders.ru.nl>
Message-ID: <WED.28.APR.2010.235029.0200.FIELDTRIP@NIC.SURFNET.NL>

Hi Matteo,





There is an old thread on the FT discussion list about the details of
coherence testing using indepsamplesZcoh combined with clustering. You can
find it via the FT homepage.



Best,



Eric





dr. Eric Maris
Donders Institute for Brain, Cognition and Behavior

Center for Cognition and F.C. Donders Center for Cognitive Neuroimaging

Radboud University
P.O. Box 9104
6500 HE Nijmegen
The Netherlands
T:+31 24 3612651
Mobile: 06 39584581

F:+31 24 3616066
E: e. <mailto:e.maris at donders.ru.nl> maris at donders.ru.nl







From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of jan-mathijs schoffelen
Sent: woensdag 28 april 2010 14:05
To: FIELDTRIP at NIC.SURFNET.NL
Subject: Re: [FIELDTRIP] Non parametric test on coherence



Hi Matteo,



As far as I know, the indepsamplesZcoh only works properly if you compute
your TFR using ft_freqanalysis with cfg.output = 'fourier'.

Note that the output of the statistics-function probably gives differential
coherence spectra between all pairs of channels. The clustering will in this
case not work, because the spatial channel neighbourhood structure supported
to my knowledge only works with univariate test-statistics. This means that
you shouldn't specify cfg.correctm = 'cluster'.



Cheers,



Jan-Mathijs



On Apr 28, 2010, at 1:57 PM, Matteo Demuru wrote:





Dear Eric,



I have tried the between-trials experiment too, but the two problems still
remain (the statfun_indepsamplesZcoh looks for label field. Furtheremore if
I add it the reshape function crashes). Any other suggestions?



I have also another question relative to your reply: the baseline and
activation trials were already divided in the within-trials experiment, the
only difference with the between-trials experiment are relative to the
configuration parameters (i.e.  in between-trials only cfg.ivar is set while
in within-trials cfg.ivar and cfg.uvar are set) am I wrong?



Regarding the 'label field' problem, it seems a required field for the
configuration struct because it is used in statfun_indepsamplesZcoh to
calculate the channel combinations for the coherence.



Thanks a lot



Matteo





On Wed, Apr 28, 2010 at 9:17 AM, Eric Maris <e.maris at donders.ru.nl> wrote:

Dear Matteo,





The statfun indepsamplesZcoh can only be used in a between-trials
experiment. You could cut out your baseline and activation segments
separately and then compare them in a non-paired fashion.





Best,



Eric





From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf
Of Matteo Demuru
Sent: dinsdag 27 april 2010 16:21
To: FIELDTRIP at NIC.SURFNET.NL
Subject: [FIELDTRIP] Non parametric test on coherence



Dear all,



I have a problem using freqstatistics to calculate significance for
coherence.



Specifically I have a subject and I am performing a within-trials experiment
using 'indepsamplesZcoh' as statistic.



I calculate the TFR of my data with the cfg.output='powandcsd' and
cfg.keeptrials='yes' parameters. Then I call freqstatistics to compare my
different experimental conditions (baseline vs activation).



The function crashes with this output:



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



Error in ==> statfun_indepsamplesZcoh at 76

  nchan = length(cfg.label);



I have tried to add this field to the cfg struct assigning the cell that
contains the interested channels. However this time I have another error:



??? Error using ==> reshape

To RESHAPE the number of elements must not change.



Error in ==> clusterstat at 178

      posclusobs = findcluster(reshape(postailobs,
[cfg.dim,1]),channeighbstructmat,cfg.minnbchan);





Any suggestions?



Thanks in advance



Matteo Demuru



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/

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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/



Dr. J.M. (Jan-Mathijs) Schoffelen

Donders Institute for Brain, Cognition and Behaviour,
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands

J.Schoffelen at donders.ru.nl

Telephone: 0031-24-3668063



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

The aim of this list is to facilitate the discussion between users of the
FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and
EEG analysis.

http://listserv.surfnet.nl/archives/fieldtrip.html

http://www.ru.nl/fcdonders/fieldtrip/


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100428/0216d7b5/attachment.htm>

From khoechstetter at BESA.DE  Thu Apr 29 17:06:45 2010
From: khoechstetter at BESA.DE (Karsten Hoechstetter)
Date: Thu, 29 Apr 2010 17:06:45 +0200
Subject: Upcoming BESA Workshop prior to HBM in Barcelona
Message-ID: <THU.29.APR.2010.170645.0200.>

Dear colleagues,

 

I would like to inform you that a 2-day BESA Research workshop will be held
in Barcelona/Spain on June 4-5, prior to the HBM conference.

 

The workshop provides a thorough introduction to BESA Research, the widely
used software for comprehensive EEG/MEG data analysis. The new version, BESA
Research 5.3, features a direct MATLAB interface that e.g. allows for direct
data transfer from BESA to Fieldtrip.

 

The workshop includes both lectures and practical hands-on sessions. Target
group are both novices and existing BESA users.

 

Covered topics will include:

-          A theoretical introduction to source analysis

-          Hands-on source analysis with simulated and real data sets

-          Data preprocessing in BESA Research: Artifact rejection and
correction, channel interpolation, digital filtering, 3D mapping,
remontaging, averaging

-          Coregistration with (f)MRI

-          Time-frequency analysis and source coherence

-          Beamforming

-          3D volume imaging: CLARA, LORETA, sLORETA, minimum norm etc.

-          MATLAB Interface

-          Batch scripting

 

Additional BESA Research workshops will be held in London (Sep. 9-10) and
San Diego (most likely Nov. 11-12, prior to the SFN conference).

 

For more information, schedule, and registration, please visit the BESA
website at www.besa.de/events/workshops. If you have any further questions,
please contact workshop at besa.de. I would be glad to see you on one of these
occasions!

 

Best wishes,

Karsten Hoechstetter

 

 

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

Dr. Karsten Hoechstetter

MEGIS Software GmbH

Gräfelfing, Germany

HRB München 109956

CEO Dr. Michael Scherg

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

 


----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20100429/dae96d10/attachment.htm>

