JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for SPM Archives


SPM Archives

SPM Archives


SPM@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

SPM Home

SPM Home

SPM  December 2010

SPM December 2010

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: SPM & Fieldtrip

From:

Vladimir Litvak <[log in to unmask]>

Reply-To:

Vladimir Litvak <[log in to unmask]>

Date:

Wed, 8 Dec 2010 20:53:05 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (244 lines)

Dear Kambiz,

You should not keep your external Fieldtrip and SPM in the path at the
same time. Since SPM's internal Fieldtrip is now identical to standard
Fieldtrip release with some non-critical omissions there should
usually be no need for you to also have another Fieldtrip in the path.
If you want to use full version of Fieldtrip anyway then remove it
from the path before working with SPM.

Vladimir

Sent from my iPad

On 8 Dec 2010, at 20:48, "Tavabi, Kambiz" <[log in to unmask]> wrote:

> Vladimir,
> Since updating to the newest releases of both SPM8 and Fieldtrip something has gone awry when invoking SPM from matlab. For some reason the search path for SPM is associated with the file .../fieldtrip/external/spm2/spm.m Am I missing something or have I gone and screwed things up?
> -K.
> -------------------------------------------------------------
> Kambiz Tavabi PhD
> Biomedical Imaging Laboratory
> The Children's Hospital of Philadelphia
> 34th Street and Civic Center Boulevard
> Philadelphia, Pa. 19104
> Tel: 267.426.0302
> email: [log in to unmask]
> -------------------------------------------------------------
> ________________________________________
> From: Vladimir Litvak [[log in to unmask]]
> Sent: Tuesday, December 07, 2010 12:46 PM
> To: Tavabi, Kambiz
> Subject: Re: [SPM] Simple effects analysis on 2D image
>
> Hmm, try using the version from ftp://ftp.fil.ion.ucl.ac.uk/spm/restricted/beta/spm8_r4134.zip
>
> These are just some incompatibilities having to do with changes in Fieldtrip code structure. Hopefully things have stabilized since the last public release.
>
> Vladimir
>
> On Tue, Dec 7, 2010 at 4:37 PM, Tavabi, Kambiz <[log in to unmask]<mailto:[log in to unmask]>> wrote:
> Ok., still an issue though:
>>> spm_eeg_ft2spm(ftdata,'r53bCtrlHi');
> checkmeeg: no channel type, assigning default
> checkmeeg: no units, assigning default
> checkmeeg: data scale missing, assigning default
> checkmeeg: data type is missing or incorrect, assigning default
> ??? Undefined function or method 'ft_chantype' for input arguments of type 'cell'.
>
> Error in ==> spm_eeg_prep at 60
>       type = ft_chantype(D.chanlabels);
>
> Error in ==> spm_eeg_ft2spm at 145
> D = spm_eeg_prep(S1);
>
> Could it be that spm_eeg_prep(S1); doesn't like my:
> ftdata.label <2x1 cell>
> 'aclt'
> 'acrt'
> -K.
> -------------------------------------------------------------
> Kambiz Tavabi PhD
> Biomedical Imaging Laboratory
> The Children's Hospital of Philadelphia
> 34th Street and Civic Center Boulevard
> Philadelphia, Pa. 19104
> Tel: 267.426.0302
> email: [log in to unmask]<mailto:[log in to unmask]>
> -------------------------------------------------------------
> ________________________________________
> From: Vladimir Litvak [[log in to unmask]<mailto:[log in to unmask]>]
> Sent: Tuesday, December 07, 2010 11:26 AM
> To: Tavabi, Kambiz
> Subject: Re: [SPM] Simple effects analysis on 2D image
>
> That's our fault although strange that it went undetected. Change
> fileio_ to ft_ in the code.
>
> Vladimir
>
>
>
> Sent from my iPad
>
> On 7 Dec 2010, at 16:17, "Tavabi, Kambiz" <[log in to unmask]<mailto:[log in to unmask]>> wrote:
>
>> Sorry about that, I felt like a real nimrod. I still can't get through however. Now it fails at line 145 with:
>> ftdata =
>>
>>   powspctrm: [2x158x2880 double]
>>       label: {2x1 cell}
>>        time: [1x2880 double]
>>        freq: [1x158 double]
>>      dimord: 'chan_freq_time'
>>
>>>> spm_eeg_ft2spm(ftdata,'r53bCtrlHi');
>> checkmeeg: no channel type, assigning default
>> checkmeeg: no units, assigning default
>> checkmeeg: data scale missing, assigning default
>> checkmeeg: data type is missing or incorrect, assigning default
>> ??? Undefined function or method 'fileio_chantype' for input arguments of type 'cell'.
>>
>> Error in ==> spm_eeg_prep at 60
>>       type = fileio_chantype(D.chanlabels);
>>
>> Error in ==> spm_eeg_ft2spm at 145
>> D = spm_eeg_prep(S1);
>>
>> -K.
>> -------------------------------------------------------------
>> Kambiz Tavabi PhD
>> Biomedical Imaging Laboratory
>> The Children's Hospital of Philadelphia
>> 34th Street and Civic Center Boulevard
>> Philadelphia, Pa. 19104
>> Tel: 267.426.0302
>> email: [log in to unmask]<mailto:[log in to unmask]>
>> -------------------------------------------------------------
>> ________________________________________
>> From: Vladimir Litvak [[log in to unmask]<mailto:[log in to unmask]>]
>> Sent: Tuesday, December 07, 2010 11:04 AM
>> To: Tavabi, Kambiz
>> Subject: Re: [SPM] Simple effects analysis on 2D image
>>
>> Dear Kambiz,
>>
>> You are on the right track. Just changed 'dimrod' to 'dimord' and it
>> should work.
>>
>> Vladimir
>>
>> Sent from my iPad
>>
>> On 7 Dec 2010, at 15:33, "Tavabi, Kambiz" <[log in to unmask]<mailto:[log in to unmask]>> wrote:
>>
>>> Dear Vladimir,
>>>
>>> I am aware of field2bert; and my initial question was whether it is possible to take the 2D TF values I already have and utilize specific functions to get the data into SPM for testing. I believe it is possible as long as you would kindly provide the explicit list of items that ftdata structure must have to get through spm_eeg_ft2spm. There is no explanation of input/output in the code! Moreover, I have made attempts to create ftdata from what I have based on the specs in http://fieldtrip.fcdonders.nl/faq/how_are_the_various_data_structures_defined?s[]=freq#frequency_and_time-frequency_data. That was essentially what I wrote in my second email yesterday, that I notice some discrepancy between field names in the Fieldtrip TF data structure and your code, notably:
>>> 'trial' - not in Frequency and Time-Frequency data structure
>>> 'individual'- not in Frequency and Time-Frequency data structure
>>> 'avg'- not in Frequency and Time-Frequency data structure
>>> 'fsample' - not in Frequency and Time-Frequency data structure
>>> 'hdr'- not in Frequency and Time-Frequency data structure
>>> 'hdr.grad'- not in Frequency and Time-Frequency data structure
>>> Also I'm unsure what goes into 'grad' and 'cfg' which I didn't noticed referenced in your code, so presumably they can be left blank.
>>>
>>> for example according to the Fieldtrip website ftdata.dimrod = 'chan_freq_time', correct? but passing that to your code gives me:
>>> My ftdata:
>>> ftdata =
>>>     dimrod: 'chan_freq_time'
>>>  powspctrm: [2x158x2880 double]
>>>      label: {2x1 cell}
>>>       time: [1x2880 double]
>>>       freq: [1x158 double]
>>>
>>> My call:
>>> spm_eeg_ft2spm(ftdata,'test.mat');
>>>
>>> My result:
>>> ??? Reference to non-existent field 'dimord'.
>>> Error in ==> spm_eeg_ft2spm at 42
>>>  rptind=strmatch('rpt', tokenize(ftdata.dimord, '_'));
>>>
>>> What I refuse to do is begin from scratch to simplify my pipeline, because (a) I don't know what 'code' you're talking about and (b) I've invested too much time and effor to get to this point again using SPM only to find another surprise curteousy of SPM.
>>> -K.
>>> -------------------------------------------------------------
>>> Kambiz Tavabi PhD
>>> Biomedical Imaging Laboratory
>>> The Children's Hospital of Philadelphia
>>> 34th Street and Civic Center Boulevard
>>> Philadelphia, Pa. 19104
>>> Tel: 267.426.0302
>>> email: [log in to unmask]<mailto:[log in to unmask]>
>>> -------------------------------------------------------------
>>> ________________________________________
>>> From: Vladimir Litvak [[log in to unmask]<mailto:[log in to unmask]>]
>>> Sent: Monday, December 06, 2010 4:59 PM
>>> To: Tavabi, Kambiz
>>> Cc: [log in to unmask]<mailto:[log in to unmask]>
>>> Subject: Re: [SPM] Simple effects analysis on 2D image
>>>
>>> Dear Kambiz,
>>>
>>> field2bert is not a Fieldtrip function, but based on quick Google search this is something that originates from the people in Cardiff. So its output is not a Fieldtrip struct. We now have very similar functionality in SPM which was actually based on code I got from Cardiff so perhaps you could use that to get the same results immediately in SPM format and greatly simplify your pipeline. This is the 'Hilbert' option in 'Time-frequency'.
>>>
>>> If you want to create a Fieldtrip struct from your data see
>>>
>>> http://fieldtrip.fcdonders.nl/faq/how_are_the_various_data_structures_defined?s[]=freq#frequency_and_time-frequency_data
>>>
>>> for some useful documentation. This should not be difficult but as I said I find it too cumbersome.
>>>
>>> Best,
>>>
>>> Vladimir
>>>
>>>
>>> On Mon, Dec 6, 2010 at 4:48 PM, Tavabi, Kambiz <[log in to unmask]<mailto:[log in to unmask]><mailto:[log in to unmask]<mailto:[log in to unmask]>>> wrote:
>>> Vladimir - thanks for the response to my question. Perhaps you might provide a little more detail after considering the following. I have epoched (-0.8 - 1.6 sec0) 2D data for left/right virtual sensors in 10 subjects, in a 2 x 2 design. The MEG data was sampled at 12 kHz, and the time-frequency representations were computed using a Fieldtrip fucntion (field2bert). Its output is  the bertogram time-frequency representation of induced+evoked effects calculated (at 0.5Hz fsteps between 1.5-80 Hz).
>>> Meaning that for each condition and subject I have an mxn matrix, where m contains power values for each frequency bin and n is the number of time-points. If I understand you correctly I can enter the matrices into my design matrix, or do I need to convert the images into SPM format? When I pass just the matrix of power values to spm_eeg_ft2spm I get the following:
>>> ??? Attempt to reference field of non-structure array.
>>> Error in ==> spm_eeg_ft2spm at 13
>>> if iscell(ftdata.time)
>>> What exactly should ftdata contain/or be formatted?
>>>
>>>
>>> -K.
>>> -------------------------------------------------------------
>>> Kambiz Tavabi PhD
>>> Biomedical Imaging Laboratory
>>> The Children's Hospital of Philadelphia
>>> 34th Street and Civic Center Boulevard
>>> Philadelphia, Pa. 19104
>>> Tel: 267.426.0302
>>> email: [log in to unmask]<mailto:[log in to unmask]><mailto:[log in to unmask]<mailto:[log in to unmask]>>
>>> -------------------------------------------------------------
>>> ________________________________________
>>> From: Vladimir Litvak [[log in to unmask]<mailto:[log in to unmask]><mailto:[log in to unmask]<mailto:[log in to unmask]>>]
>>> Sent: Monday, November 08, 2010 5:50 PM
>>> To: Tavabi, Kambiz
>>> Cc: [log in to unmask]<mailto:[log in to unmask]><mailto:[log in to unmask]<mailto:[log in to unmask]>>
>>> Subject: Re: [SPM] Simple effects analysis on 2D image
>>>
>>> Dear Kambiz,
>>>
>>> Yes, you can use SPM functions to analyse 2D time-frequency images.
>>> See http://www.ncbi.nlm.nih.gov/pubmed/15663957
>>>
>>> In practice you can either convert your TF matrices to images using
>>> your own code or convert your TF data to Fieldtrip freq structure and
>>> then use spm_eeg_ft2spm to convert this struct to SPM dataset and
>>> subsequently convert it to images using the SPM function in 'Other'.
>>>
>>> Best,
>>>
>>> Vladimir
>>>
>>> Sent from my iPad
>>>
>>> On 8 Nov 2010, at 22:00, Kambiz Tavabi <[log in to unmask]<mailto:[log in to unmask]><mailto:[log in to unmask]<mailto:[log in to unmask]>>> wrote:
>>>
>>>> I am trying to analyse 2D MEG data, within what I think fits the SPM frame work. I have time-frequency data computed using a Wavelet approach in each subject for a 3 x 2 design.  I would like to carry out voxel-wise, fixed effects analysis of the time-frequency data. My goal is to identify time-windows showing effects of fixed factors on narrow band power. Is it possible to call specific SPM functions to carry out this type of analysis? Thanks in advance.
>>>> Kambiz
>>>
>

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager