Dear Vladimir,
Thanks for your help. I used the instructions further down in the
manual as you suggested and it worked flawlessly (I wish I had seen
them earlier.. I spent way too much time on this).
Best,
Martin
On Tue, Nov 10, 2009 at 4:48 PM, Vladimir Litvak <[log in to unmask]> wrote:
> Dear Martin,
>
> What you did won't work because the elements in trialdef correspond to
> event types and not to single events. It's not possible to use
> spm_eeg_definetrial to assign two different trial labels in this
> situation because there is only one event type in the file. What you
> should do is either epoch first and reassign condition labels later as
> shown in the manual (look a little bit further down) or you can do
> something like:
>
> ----
>
> labels = textread('condition_labels.txt', '%s');
>
> D = spm_eeg_load('Mdspm8_faces_run1.mat');
>
> S = [];
> S.dataset = fullfile(D.path, D.fname);
> S.pretrig = 400;
> S.posttrig = 600;
> S.trialdef(1).conditionlabel = 'whatever';
> S.trialdef(1).eventtype = 'STATUS';
> S.trialdef(1).eventvalue = 1;
> S.reviewtrials = false;
> S.save = false;
> trl = spm_eeg_definetrial(S);
>
> S = [];
> S.D = D;
> S.epochinfo.trl = trl;
> S.epochinfo.conditionlabels = labels;
> D = spm_eeg_epochs(S)
>
> -----
>
> Best,
>
> Vladimir
>
>
>
> On Tue, Nov 10, 2009 at 6:12 PM, Martin Luessi
> <[log in to unmask]> wrote:
>> Hi,
>>
>> I'm following the EEG preprocessing instructions for the "Multimodal
>> Faces" data set in SPM8. Unfortunately copy-pasting the conditions
>> labels as described under 34.4.5 does not work for me (it does only
>> paste into once cell, not the whole column, I'm using Matlab R2007b
>> under Linux). So I wrote a script to do the epoching and assign the
>> right condition labels. However, I must be doing something wrong, as
>> Matlab stays busy forever (epoching as described under 34.4.4 is very
>> fast). I'm using the following script:
>>
>> -------------------------------------------------------------------------------
>> labels = textread('condition_labels.txt', '%s');
>>
>> S = struct;
>> S.D = spm_eeg_load('Mdspm8_faces_run1.mat')
>>
>> S.pretrig = 400;
>> S.posttrig = 600;
>> S.trialdef = struct
>>
>> for ii=1:length(labels)
>> S.trialdef(ii,1).conditionlabel = labels{ii};
>> S.trialdef(ii,1).eventtype = 'STATUS';
>> S.trialdef(ii,1).eventvalue = '1';
>> end
>>
>> S.reviewtrials = false
>> S.save = true
>>
>> D = spm_eeg_epochs(S)
>> --------------------------------------------------------------------------
>>
>> Any hints on what I'm doing wrong are greatly appreciated.
>>
>> Martin
>>
>> ______________________________________
>> Martin Luessi, M.S.
>> PhD Candidate
>> Department of Electrical Engineering and Computer Science
>> Northwestern University
>> http://ivpl.eecs.northwestern.edu/people/mluessi
>>
>
--
______________________________________
Martin Luessi, M.S.
PhD Candidate
Department of Electrical Engineering and Computer Science
Northwestern University
http://ivpl.eecs.northwestern.edu/people/mluessi
|