In the case of EEG BEM which is what you are using you should also add:
if isa(vol, 'char')
vol = fileio_read_vol(vol);
end
Vladimir
On Wed, May 6, 2009 at 12:05 PM, Vladimir Litvak
<[log in to unmask]> wrote:
> Dear Stephan,
>
>>> I would like to compare source solutions from spm with solutions
>>> computed in fieldtrip. I would like to use the headmodel and electrode
>>> locations that I used in the previous steps in spm. Could you ev. give
>>> me some hints on how convert from spm to fieldtrip format?
>
> Something like this should do the trick (assuming a single modality
> and a single inverse solution):
>
> D = spm_eeg_load;
>
> data = D.ftraw(0);
> vol = D.inv{1}.forward(1).vol;
> elec = D.inv{1}.datareg(1).sensors;
>
> % Your fieldtrip code from here on
>
>
> You can look at the function spm_eeg_ft_dipolefitting in
> /toolbox/MEEGTools for an example of more generic code.
>
> Best,
>
> Vladimir
>
>
>
> On Wed, May 6, 2009 at 11:50 AM, Guillaume Flandin
> <[log in to unmask]> wrote:
>> Dear Stephan,
>>
>>> thanks for your quick response!!
>>> actually, for some reason these mex files (ptriproj.mexw64) were not in
>>> my spm8 folders. I may have used an old version. sorry for not checking
>>> before bothering you. after compiling with the code you sent me, it
>>> worked fine.
>>
>> good news.
>>
>>> however, I also just downloaded spm8 again (this time ptriproj.mexw64
>>> were included :) ). when I redo the steps with the newly downloaded spm8
>>> (that now work fine with my previous version) I run into this error when
>>> computing the forward solution... I don't mind using my previous
>>> version, but still it would be nice to know what might be going on here.
>>>
>>> here is the error message:
>>>
>>> using the pre-specified triangulated boundaries
>>> determining source compartment (1)
>>> determining skin compartment (3)
>>> not using the isolated source approach
>>> ??? Index exceeds matrix dimensions.
>>>
>>> Error in ==> fitsphere at 64
>>> [...]
>>>
>>> Would you have an idea what that could be?
>>
>> yes, this is a bug we fixed recently and the two files to update are
>> available from there:
>> https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=SPM;fmQtUw;20090430181242%2B0100
>>
>>> Also, I have another question:
>>> I would like to compare source solutions from spm with solutions
>>> computed in fieldtrip. I would like to use the headmodel and electrode
>>> locations that I used in the previous steps in spm. Could you ev. give
>>> me some hints on how convert from spm to fieldtrip format?
>>
>> I leave this question to Vladimir, in copy of this email, who has
>> extensive knowledge about SPM <-> FieldTrip gateway.
>>
>> Best regards,
>> Guillaume.
>>
>> --
>> Guillaume Flandin, PhD
>> Wellcome Trust Centre for Neuroimaging
>> University College London
>> 12 Queen Square
>> London WC1N 3BG
>>
>
|