Hi Stephan,<br><br>Thanks very much for your reply (and sorry for not replying to the thread; I get a digest, and couldn't figure out how to reply to an individual message).  So, SPM will produce an outdated .grad format, which can be corrected.<br>
<br>There is one thing I don't get, which is why ft_chantype looks for the older fields, viz:<br><pre><i>isgrad   = isa(input, 'struct') && isfield(input, 'pnt') && isfield(input, 'ori');</i></pre>
<br>It seems like the function ft_chantype is called from, ft_datatype_sens, automatically corrects the old grad format before passing the structure (now called 'sens') to ft_chantype:<br><br>% sensor description is a MEG sensor-array, containing oriented coils<br>
[chanpos, chanori, chanlab] = channelposition(sens, 'channel', 'all');<br>sens.coilori = sens.ori; sens = rmfield(sens, 'ori');<br>sens.coilpos = sens.pnt; sens = rmfield(sens, 'pnt');<br>sens.chanpos = chanpos;<br>
sens.chanori = chanori;<br><br>Did the new format not propagate through?<br><br>best wishes,<br>George<br><br><br><div class="gmail_quote">On Mon, Sep 10, 2012 at 2:55 PM,  <span dir="ltr"><<a href="mailto:fieldtrip-request@science.ru.nl" target="_blank">fieldtrip-request@science.ru.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send fieldtrip mailing list submissions to<br>
        <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:fieldtrip-request@science.ru.nl">fieldtrip-request@science.ru.nl</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:fieldtrip-owner@science.ru.nl">fieldtrip-owner@science.ru.nl</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of fieldtrip digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. about overlap in PSD calculation (Ivano Triggiani)<br>
   2. real-value spatial filter from FFT dipole localization?<br>
      (Bj?rn Herrmann)<br>
   3. Appending data.grad, after using D.ftraw(0) (George Wallis)<br>
   4. Re: Appending data.grad, after using D.ftraw(0)<br>
      (<a href="mailto:smoratti@psi.ucm.es">smoratti@psi.ucm.es</a>)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 10 Sep 2012 11:27:09 +0100 (BST)<br>
From: Ivano Triggiani <<a href="mailto:ivano_triggiani@yahoo.it">ivano_triggiani@yahoo.it</a>><br>
To: "<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>" <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>><br>
Subject: [FieldTrip] about overlap in PSD calculation<br>
Message-ID:<br>
        <<a href="mailto:1347272829.31720.YahooMailNeo@web133103.mail.ir2.yahoo.com">1347272829.31720.YahooMailNeo@web133103.mail.ir2.yahoo.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi all.<br>
<br>
How can I obtain informations about the kind of overlapping performed by fiedltrip implemented method to obtain a Power Spectral Density ?<br>
<br>
I need to compare fieldtrip PSD with another spectral density, so I need to be sure of everything. I found docs about tapering, but I don't understand if using a kind of tapering the overlapping is given.<br>
Ivano<br>
<br>
?<br>
------------------------------------------------------------------------<br>
<br>
<br>
<br>
<br>
"No man can wear one face to himself<br>
and another to the multitude,<br>
without finally getting bewildered<br>
as to which one is true."<br>
<br>
<br>
Nathaniel Hawthorne<br>
<br>
<br>
________________________________<br>
 Da: "<a href="mailto:fieldtrip-request@science.ru.nl">fieldtrip-request@science.ru.nl</a>" <<a href="mailto:fieldtrip-request@science.ru.nl">fieldtrip-request@science.ru.nl</a>><br>
A: <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
Inviato: Luned? 10 Settembre 2012 12:00<br>
Oggetto: fieldtrip Digest, Vol 22, Issue 17<br>
<br>
Send fieldtrip mailing list submissions to<br>
??? <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
??? <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
or, via email, send a message with subject or body 'help' to<br>
??? <a href="mailto:fieldtrip-request@science.ru.nl">fieldtrip-request@science.ru.nl</a><br>
<br>
You can reach the person managing the list at<br>
??? <a href="mailto:fieldtrip-owner@science.ru.nl">fieldtrip-owner@science.ru.nl</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of fieldtrip digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
?  1. Using WPLI od WPLI-debiased to do the coherence analysis<br>
? ? ? (sahand babapoor)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sun, 9 Sep 2012 20:49:31 -0400<br>
From: sahand babapoor <<a href="mailto:sahand.babapoor@gmail.com">sahand.babapoor@gmail.com</a>><br>
To: <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
Subject: [FieldTrip] Using WPLI od WPLI-debiased to do the coherence<br>
??? analysis<br>
Message-ID:<br>
??? <<a href="mailto:CAPWLZVVY9oDYS9NuRceBvK0-%2B%2BPcRe5p-Ni88%2BafmVdEMxa_1A@mail.gmail.com">CAPWLZVVY9oDYS9NuRceBvK0-++PcRe5p-Ni88+afmVdEMxa_1A@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi all,<br>
<br>
I am trying to do coherency analysis between ACC and FEF. I have tried both<br>
WPLI and WPLI-debiased methods to do the analysis. When I am using WPLI I<br>
find a very nice coherence pattern between ACC and FEF in the frequencies<br>
between ~11Hz to 20 Hz. However, when I am using WPLI-debiased method, the<br>
previous WPLI coherence pattern disappears and? breaks into many sparse<br>
clusters across many time points and frequencies. Is there a way to know<br>
which method is the best for me. I should note that I am recording using<br>
tungsten microelectrodes advanced into the brain. I would appreciate if<br>
your help.<br>
<br>
Best,<br>
Sahand<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120909/2a47bbc7/attachment-0001.html" target="_blank">http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120909/2a47bbc7/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<br>
End of fieldtrip Digest, Vol 22, Issue 17<br>
*****************************************<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120910/448a5494/attachment-0001.html" target="_blank">http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120910/448a5494/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Mon, 10 Sep 2012 13:16:09 +0200 (CEST)<br>
From: Bj?rn Herrmann <<a href="mailto:bherrmann@cbs.mpg.de">bherrmann@cbs.mpg.de</a>><br>
To: <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
Subject: [FieldTrip] real-value spatial filter from FFT dipole<br>
        localization?<br>
Message-ID: <1396322041.3317.1347275769488.JavaMail.root@zimbra><br>
Content-Type: text/plain; charset=utf-8<br>
<br>
Dear fieldtrip users,<br>
<br>
maybe someone can point me in the right direction. I try to obtain a spatial filter from localizing the sources of an auditory 3Hz peak in my FFT spectrum. I would like to apply the filter to my single trial real data, i.e. basically reducing my 204 gradiometer channels (neuromag system) to one or two channels in source space.<br>

I was using DICS beamformer and cfg.realfilter = 'yes' but the source localization results (NAI) looked not too well compared to the nice auditory gradiometer topographies.<br>
I then used ft_dipolefitting, however, I have trouble understanding the output. This is where I wondered whether someone could help me, in telling whether it is possible to obtain a real-value spatial filter from this:<br>

<br>
source =<br>
     label: {204x1 cell}<br>
       dip: [1x1 struct]<br>
     Vdata: [204x408 double]<br>
    Vmodel: [204x408 double]<br>
      freq: 3<br>
    dimord: 'chan_freq'<br>
      grad: [1x1 struct]<br>
       cfg: [1x1 struct]<br>
<br>
source.dip =<br>
        pos: [2x3 double]<br>
        mom: [6x408 double]<br>
        pot: [204x408 double]<br>
         rv: [1x408 double]<br>
        pow: 2.7948e+18<br>
        csd: [6x6 double]<br>
    fourier: [6x204 double]<br>
<br>
I would appreciate helping comments, as I tested the different methods for some time now, but was unable to extract a reasonable real-value spatial filter for my auditory cortex activations.<br>
<br>
Best regards,<br>
<br>
Bj?rn<br>
<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Mon, 10 Sep 2012 13:22:20 +0100<br>
From: George Wallis <<a href="mailto:wallisgj@gmail.com">wallisgj@gmail.com</a>><br>
To: <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
Subject: [FieldTrip] Appending data.grad, after using D.ftraw(0)<br>
Message-ID:<br>
        <<a href="mailto:CADqk8UgZ-wUf-FAjLL9K0hScW6ZTWrOVJKaR0S%2BPVhvuKx31-w@mail.gmail.com">CADqk8UgZ-wUf-FAjLL9K0hScW6ZTWrOVJKaR0S+PVhvuKx31-w@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Dear fieldtrippers,<br>
<br>
if anyone can help me with this I'd be very grateful!<br>
<br>
I have a bunch of preprocessed and epoched data files in SPM format, and<br>
I'm converting them to fieldtrip format using the following:<br>
<br>
D  = spm_eeg_load(fn);<br>
data = D.ftraw(0);<br>
<br>
...which results in...<br>
<br>
data =<br>
<br>
    fsample: 250<br>
      label: {350x1 cell}<br>
      trial: {1x360 cell}<br>
       time: {1x360 cell}<br>
<br>
Comparing this to data structures generated using fieldtrip alone, field<br>
like data.grad are missing.<br>
<br>
I can create something like a grad field by doing:<br>
<br>
D.sensors('MEG')<br>
<br>
ans =<br>
<br>
      pnt: [510x3 double]<br>
      ori: [510x3 double]<br>
      tra: [306x510 double]<br>
     unit: 'mm'<br>
    label: {306x1 cell}<br>
<br>
If I then append this to the data:<br>
<br>
data.grad = D.sensors('MEG');<br>
<br>
I get an error:<br>
<br>
---<br>
<br>
Error using ft_chantype (line 56)<br>
the input that was provided to this function cannot be deciphered<br>
<br>
Error in ft_datatype_sens (line 128)<br>
        sens.chantype = ft_chantype(sens);<br>
<br>
Error in ft_datatype_raw (line 99)<br>
      data.grad = ft_datatype_sens(data.grad);<br>
<br>
Error in ft_checkdata (line 177)<br>
  data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo);<br>
<br>
Error in ft_timelockanalysis (line 134)<br>
data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes',<br>
'hassampleinfo',<br>
'yes');<br>
<br>
Error in ft_SENS_ERF_grRep (line 82)<br>
            avdat = ft_timelockanalysis(cfg,raw);<br>
<br>
---<br>
<br>
...when I try to do timelockanalysis on this data.  If I leave the grad<br>
field off (i.e. not append it to the output of ftraw(0)) there's no<br>
problem, and the analysis runs fine.  However, because I want to do spatial<br>
neighbour cluster analysis later, I think I need the .grad field, so I<br>
might as well get it incorporated at this stage.<br>
<br>
Going a bit further into the error messages above, the function<br>
ft_datatype_sens appears to convert the old format .ori, .pnt into the<br>
newer .coilori, .coilpos ... etc.  But the next function in the chain,<br>
ft_chantype, looks for .pnt and .ori when doing:<br>
<br>
isgrad   = isa(input, 'struct') && isfield(input, 'pnt') && isfield(input,<br>
'ori');<br>
<br>
I'm wondering if this could be the problem?<br>
<br>
Sorry for the long message!  I'd be very grateful if anyone can help out.<br>
<br>
Best wishes,<br>
George<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120910/8418e2de/attachment-0001.html" target="_blank">http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120910/8418e2de/attachment-0001.html</a>><br>

<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Mon, 10 Sep 2012 15:55:26 +0200<br>
From: "<a href="mailto:smoratti@psi.ucm.es">smoratti@psi.ucm.es</a>" <<a href="mailto:smoratti@psi.ucm.es">smoratti@psi.ucm.es</a>><br>
To: FieldTrip discussion list <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>><br>
Subject: Re: [FieldTrip] Appending data.grad, after using D.ftraw(0)<br>
Message-ID: <<a href="mailto:44D6E4E8-E44D-4D08-B012-C3B506F6E935@psi.ucm.es">44D6E4E8-E44D-4D08-B012-C3B506F6E935@psi.ucm.es</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Dear George,<br>
<br>
Your approach was right, and it would have worked with older versions of field trip. Now in field trip the grad field contents have changed a little bit.<br>
<br>
Now it contains<br>
<br>
balance: [1x1 struct]<br>
     chanori: [306x3 double]<br>
     chanpos: [306x3 double]<br>
    chantype: {306x1 cell}<br>
    chanunit: {306x1 cell}<br>
     coilori: [510x3 double]<br>
     coilpos: [510x3 double]<br>
       label: {306x1 cell}<br>
         tra: [306x510 double]<br>
        unit: 'cm'<br>
<br>
so the field put would be chanpos, ori would be chanori (or coilpos/ coilori depending on your MEG system).<br>
<br>
So check this out and you can easily adapt the structure. I think SPM does not go with the ?ltimate field trip version.<br>
<br>
I hope this helps,<br>
<br>
best,<br>
<br>
Stephan<br>
<br>
________________________________________________________<br>
Stephan Moratti, PhD<br>
<br>
see also: <a href="http://web.me.com/smoratti/" target="_blank">http://web.me.com/smoratti/</a><br>
<br>
Universidad Complutense de Madrid<br>
Facultad de Psicolog?a<br>
Departamento de Psicolog?a B?sica I<br>
Campus de Somosaguas<br>
28223 Pozuelo de Alarc?n (Madrid)<br>
Spain<br>
<br>
and<br>
<br>
Center for Biomedical Technology<br>
Laboratory for Cognitive and Computational Neuroscience<br>
Parque Cient?fico y Tecnol?gico de la Universidad Politecnica de Madrid<br>
Campus Montegancedo<br>
28223 Pozuelo de Alarc?n (Madrid)<br>
Spain<br>
<br>
<br>
email: <a href="mailto:smoratti@psi.ucm.es">smoratti@psi.ucm.es</a><br>
Tel.:    <a href="tel:%2B34%20679219982" value="+34679219982">+34 679219982</a><br>
<br>
El 10/09/2012, a las 14:22, George Wallis escribi?:<br>
<br>
> Dear fieldtrippers,<br>
><br>
> if anyone can help me with this I'd be very grateful!<br>
><br>
> I have a bunch of preprocessed and epoched data files in SPM format, and I'm converting them to fieldtrip format using the following:<br>
><br>
> D  = spm_eeg_load(fn);<br>
> data = D.ftraw(0);<br>
><br>
> ...which results in...<br>
><br>
> data =<br>
><br>
>     fsample: 250<br>
>       label: {350x1 cell}<br>
>       trial: {1x360 cell}<br>
>        time: {1x360 cell}<br>
><br>
> Comparing this to data structures generated using fieldtrip alone, field like data.grad are missing.<br>
><br>
> I can create something like a grad field by doing:<br>
><br>
> D.sensors('MEG')<br>
><br>
> ans =<br>
><br>
>       pnt: [510x3 double]<br>
>       ori: [510x3 double]<br>
>       tra: [306x510 double]<br>
>      unit: 'mm'<br>
>     label: {306x1 cell}<br>
><br>
> If I then append this to the data:<br>
><br>
> data.grad = D.sensors('MEG');<br>
><br>
> I get an error:<br>
><br>
> ---<br>
><br>
> Error using ft_chantype (line 56)<br>
> the input that was provided to this function cannot be deciphered<br>
><br>
> Error in ft_datatype_sens (line 128)<br>
>         sens.chantype = ft_chantype(sens);<br>
><br>
> Error in ft_datatype_raw (line 99)<br>
>       data.grad = ft_datatype_sens(data.grad);<br>
><br>
> Error in ft_checkdata (line 177)<br>
>   data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo);<br>
><br>
> Error in ft_timelockanalysis (line 134)<br>
> data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo',<br>
> 'yes');<br>
><br>
> Error in ft_SENS_ERF_grRep (line 82)<br>
>             avdat = ft_timelockanalysis(cfg,raw);<br>
><br>
> ---<br>
><br>
> ...when I try to do timelockanalysis on this data.  If I leave the grad field off (i.e. not append it to the output of ftraw(0)) there's no problem, and the analysis runs fine.  However, because I want to do spatial neighbour cluster analysis later, I think I need the .grad field, so I might as well get it incorporated at this stage.<br>

><br>
> Going a bit further into the error messages above, the function ft_datatype_sens appears to convert the old format .ori, .pnt into the newer .coilori, .coilpos ... etc.  But the next function in the chain, ft_chantype, looks for .pnt and .ori when doing:<br>

><br>
> isgrad   = isa(input, 'struct') && isfield(input, 'pnt') && isfield(input, 'ori');<br>
><br>
> I'm wondering if this could be the problem?<br>
><br>
> Sorry for the long message!  I'd be very grateful if anyone can help out.<br>
><br>
> Best wishes,<br>
> George<br>
> _______________________________________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
> <a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120910/444962f9/attachment.html" target="_blank">http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120910/444962f9/attachment.html</a>><br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<br>
End of fieldtrip Digest, Vol 22, Issue 18<br>
*****************************************<br>
</blockquote></div><br>