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
>>>
>
|