Print

Print


Dear Litvak,

    Thank you for the suggestion. However, in my case, some triggers are wrong because of mistake, and I have to revise them before epoching.

Delin
From: Vladimir Litvak
Date: 2015-09-23 18:22
To: SPM
Subject: Re: [SPM] SPM8 ERP: re-label event
You should epoch first and then use this code on the epoched file and the list of labels which is a cell array of strings should be exactly the same length as your trial number: D.ntrials.


Vladimir


On Wed, Sep 23, 2015 at 11:13 AM, Sun Delin <[log in to unmask]> wrote:

Dear Litvak,

    Thank you for the quick reply!
    However, the code does not work. The error reports are listed below. I in fact want to change values (which are event triggers) but not the labels. BTW, the dataset is for contineuous data before epoching.





Sun Delin

From: Vladimir Litvak
Date: 2015-09-23 18:01
To: sundelin
CC: [log in to unmask]
Subject: Re: Re: [SPM] SPM8 ERP: re-label event
Dear Sun  Delin, 


The easy thing to do in your case is not to change the event structure but to relabel the trials if you know how to make the list of labels to paste in the GUI you could do the same thing in code and I sent you the code example before, just scroll down in this e-mail.


Best,


Vladimir


On Wed, Sep 23, 2015 at 10:38 AM, Sun Delin <[log in to unmask]> wrote:

Dear Litvak,

    I made matlab scripts (as shown below) to change the values (i.e. triggers to differentiate events) of trials for ERP dataset. These values are not labels. How can I use the scripts to save changes to the dataset? It is suboptimal to manually copy and paste the new values because of the large sample size. Looking forward to your reply!
-------------------------------
D=spm_eeg_load(fname);
DATA=events(D);
........ % changing the values of the struct DATA.value
-------------------------------




Sun Delin

From: Vladimir Litvak
Date: 2015-09-21 17:33
To: [log in to unmask]
Subject: Re: [SPM] SPM8 ERP: re-label event
Dear Sun, 


If you can generate the right sequence of labels for your dataset (e.g. in Excel) you can copy and paste in in the table in the reviewing tool, press 'Update' and 'Save'.


In code you could do:


newlabels = {'1', '911', '1', .....};


D = spm_eeg_load
D = conditions(D, [], newlabels);
save(D);


Best,


Vladimir


On Mon, Sep 21, 2015 at 10:10 AM, Delin Sun <[log in to unmask]> wrote:

Dear SPM experts in ERP data analyses,

   About the ERP data, how can I re-label the task-event according to the following event's label? I utilized E-Prime 1 to mark the triggers of events, e.g. stimuli = 1 or 2, response = 11 or 12 (following stimulus 1), or 21 or 22 (following stimulus 2). These triggers can be easily viewed through the SPM8 software, and I can do both stimulus-locked (using labels 1 and 2) and response-locked (using labels 11, 12, 21 and 22) data analyses. Now, I am going to re-label the stimulus event according to the immediately following response event, e.g. re-name label 1 as 911 (if the following response is 11) or 912 (if the following response is 12), and re-name label 2 as 921 (if the following response is 21) or 922 (if the following response is 22). Through such a translation, I can analyze the stimulus-locked data according to the response made. Any suggestion is appreciated!

Bests,
Delin Sun