[Eeglablist] Changing event markers in dataset

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Tue Jul 17 15:09:15 PDT 2018


Dear Edwige,

> When I type in: events = eeg_eventtable(EEG) to have a look at all my
events, it turns out that I only get 1830 events even though my original
data file had 1842 events.

That is very strange! Where did the 12 events go??

The comparison between your table in the .csv file and events =
eeg_eventtable(EEG) also shows that their latency values are totally
different. Does it ring a bell to you?

Makoto


On Tue, Jul 17, 2018 at 8:34 AM Sijyeniyo, E. <e.sijyeniyo at student.rug.nl>
wrote:

> Dear Makoto,
>
> Through communication with your colleague, I tried re-importing the event
> markers. However, at first glance it seems to be successful, but actually
> it is not...
>
> When I type in: events = eeg_eventtable(EEG) to have a look at all my
> events, it turns out that I only get 1830 events even though my original
> data file had 1842 events.
>
> When I type in events = eeg_eventtable(EEG), I get:
>
>  'number'    'number'    'latency'       'duration'    'channel'
> 'bvtime'    'bvmknum'    'type'    'code'        'var1'
>     [     1]    [     3]    [      32.6]    '0'           [      0]    [
>    0]    [     82]    '40'      'Stimulus'        []
>     [     2]    [     4]    [     132.8]    '0'           [      0]    [
>    0]    [     83]    '9'       'Stimulus'        []
>     [     3]    [     5]    [       184]    '0'           [      0]    [
>    0]    [     84]    '13'      'Stimulus'        []
>     [     4]    [     6]    [       251]    '0'           [      0]    [
>    0]    [     85]    '17'      'Stimulus'        []
>     [     5]    [     7]    [     317.2]    '0'           [      0]    [
>    0]    [     86]    '21'      'Stimulus'        []
>     [     6]    [     8]    [     368.4]    '0'           [      0]    [
>    0]    [     87]    '25'      'Stimulus'        []
>     [     7]    [     9]    [       637]    '0'           [      0]    [
>    0]    [     88]    '29'      'Stimulus'        []
>     [     8]    [    12]    [     949.8]    '0'           [      0]    [
>    0]    [     91]    '43'      'Stimulus'        []
>     [     9]    [    13]    [      1001]    '0'           [      0]    [
>    0]    [     92]    '53'      'Stimulus'        []
>     [    10]    [    14]    [    1077.2]    '0'           [      0]    [
>    0]    [     93]    '63'      'Stimulus'        []
>     [    11]    [    15]    [    1128.2]    '0'           [      0]    [
>    0]    [     94]    '73'      'Stimulus'        []
>     [    12]    [    16]    [    1191.4]    '0'           [      0]    [
>    0]    [     95]    '83'      'Stimulus'        []
>     [    13]    [    17]    [    1388.8]    '0'           [      0]    [
>    0]    [     96]    '50'      'Stimulus'        []
>     [    14]    [    18]    [      1489]    '0'           [      0]    [
>    0]    [     97]    '10'      'Stimulus'        []
>     [    15]    [    31]    [    1539.4]    '0'           [      0]    [
>    0]    [    110]    '40'      'Stimulus'        []
>     [    16]    [    32]    [    1639.6]    '0'           [      0]    [
>    0]    [    111]    '9'       'Stimulus'        []
>     [    17]    [    33]    [    1690.8]    '0'           [      0]    [
>    0]    [    112]    '13'      'Stimulus'        []
>     [    18]    [    34]    [      1751]    '0'           [      0]    [
>    0]    [    113]    '17'      'Stimulus'        []
>     [    19]    [    35]    [      1818]    '0'           [      0]    [
>    0]    [    114]    '21'      'Stimulus'        []
>     [    20]    [    36]    [    1870.2]    '0'           [      0]    [
>    0]    [    115]    '25'      'Stimulus'        []
>     [    21]    [    37]    [    2138.8]    '0'           [      0]    [
>    0]    [    116]    '29'      'Stimulus'        []
>
> Before the red numbers, there are two events missing: 45 and 9. Moreover,
> after the red event markers '50' and '10', there are other events missing:
> 14, 18, 22, 26 and 30.
>
> This is really strange because they are in the .csv file but the are
> missing in the event structure.
> The .csv file looks like this for the first few events, comparable to what
> I get when I type in events = eeg_eventtable(EEG),
>
> 3 580 0 0 0 82 40 Stimulus 82
> 4 680.2 0 0 0 83 9 Stimulus 83
> 5 731.4 0 0 0 84 13 Stimulus 84
> 6 798.4 0 0 0 85 17 Stimulus 85
> 7 864.6 0 0 0 86 21 Stimulus 86
> 8 915.8 0 0 0 87 25 Stimulus 87
> 9 1184.4 0 0 0 88 29 Stimulus 88
> 10 1368.8 0 0 0 89 45 Stimulus 89
> 11 1469 0 0 0 90 9 Stimulus 90
> 12 1826.8 0 0 0 91 43 Stimulus 91
> 13 1878 0 0 0 92 53 Stimulus 92
> 14 1954.2 0 0 0 93 63 Stimulus 93
> 15 2005.2 0 0 0 94 73 Stimulus 94
> 16 2068.4 0 0 0 95 83 Stimulus 95
> 17 2265.8 0 0 0 96 50 Stimulus 96
> 18 2366 0 0 0 97 10 Stimulus 97
> 19 2522.4 0 0 0 98 14 Stimulus 98
> 20 2573.4 0 0 0 99 18 Stimulus 99
> 21 2620.6 0 0 0 100 22 Stimulus 100
> 22 2672.8 0 0 0 101 26 Stimulus 101
> 23 3363.2 0 0 0 102 30 Stimulus 102
> Here, you can clearly see that the red event markers are not the same
> since the EEGlab returns a different table than what my .csv file looks
> like. For this reason, importing the new event markers was half successful
> but I would like to have *all* the events imported...
>
> Do you know what might have gone wrong with this?
>
> kind regards,
> Edwige
>
>
> On Tue, Jul 17, 2018 at 2:33 PM, E. Sijyeniyo <e.sijyeniyo at student.rug.nl>
> wrote:
>
>> Dear Makoto,
>>
>> I tried re-importing my event information after exporting it to Microsoft
>> excel but it doesn’t work for some reason. I thought it would be pretty
>> straightforward, but unfortunately not….
>>
>> I get the error:
>>
>> *EEGLAB error in function import event() at line 181:*
>>
>> *Reference to non-existent field ‘latency’. *
>>
>>
>>
>>
>> If I type the following into “input field (column) names” *type latency *and
>> I change "Number of file header lines" into *1, *then I get the
>> latencies as new event markers.
>>
>> I do not understand how this may be, because I only modified the type
>> (event markers) and for some reason the new event values are not imported
>> and replaced.
>>
>> Attached you can see how my new .csv file looks like, when I try to
>> import this, I get an error and I do not know why…
>>
>> I even changed my initial triggers from e.g. *S 40* to *40* because I
>> read that EEGlab cannot read type when strings and integers are combined (
>> https://sccn.ucsd.edu/wiki/Chapter_03:_Event_Processing)
>>
>> Can you provide me with some detailed information about how to import my
>> changed event markers?
>>
>> The data was recorded with BrainVision Recorder and I am using Matlab
>> 2017b version.
>>
>> I could really use your help and expertise with this...
>>
>> Best,
>> Edwige
>>
>> Op 16 jul. 2018, om 20:13 heeft Makoto Miyakoshi <mmiyakoshi at ucsd.edu>
>> het volgende geschreven:
>>
>> Dear Edwige,
>>
>> > I am wondering whether I can change the other triggers so that they are
>> distinguishable too. In this way, I can compare, for example, the target
>> words in one particular condition with each other because they would have
>> different event markers. For instance, in the active condition, the target
>> word is marked with 17 in the prime sentence as well as in the target
>> sentence, I am not sure if Matlab would be able to distinguish them (I
>> assume not).
>>
>> I did not understand your question here. However,
>>
>> > Does anyone know how I can change event markers in my dataset?
>>
>> You can swap existing event marker types with other ones, if that solves
>> your problem. See this page. Note that this coding is done outside EEGLAB
>> so be careful.
>> https://sccn.ucsd.edu/wiki/Makoto%27s_useful_EEGLAB_code#Event_types
>>
>> If you want to do it more intuitively, you may want to consider exporting
>> the existing event structure to Microsoft Excel (or equivalent) and modify
>> it visually and manually. Then re-import the event file.
>>
>> Makoto
>>
>>
>> On Sun, Jul 15, 2018 at 9:08 PM E. Sijyeniyo <e.sijyeniyo at student.rug.nl>
>> wrote:
>>
>>> Dear EEGlab users,
>>>
>>> I have a question regarding changing event markers in my dataset.
>>>
>>> Initially, I recorded my data with the following markers:
>>>
>>> Active condition:
>>> Prime sentence: 40, 9, 13, 17, 21, 25, 29
>>> Target sentence: 45, 9, 13, 17, 21, 25, 29
>>>
>>>
>>> Passive condition
>>> Prime sentence: 40, 8, 12, 16, 20, 24, 30
>>> Target sentence: 45, 8, 12, 16, 20, 24, 30
>>>
>>>
>>> However, only the first trigger distinguishes both sentences, so only 40
>>> and 45. I am wondering whether I can change the other triggers so that they
>>> are distinguishable too. In this way, I can compare, for example, the
>>> target words in one particular condition with each other because they would
>>> have different event markers. For instance, in the active condition, the
>>> target word is marked with 17 in the prime sentence as well as in the
>>> target sentence, I am not sure if Matlab would be able to distinguish them
>>> (I assume not).
>>>
>>> So I would want to change them into something like:
>>>
>>> Active condition:
>>> Prime sentence: 40, 9, 13, 17, 21, 25, 29
>>> Target sentence: 45, 23, 33, 43, 53, 63, 73
>>>
>>> Passive condition:
>>> Prime sentence: 55, 8, 12, 16, 20, 24, 30
>>> Target sentence: 60, 26, 36, 46, 56, 66, 76
>>>
>>> Does anyone know how I can change event markers in my dataset?
>>>
>>> Thank you so much for anyone who responds!
>>>
>>> Best
>>> Edwige
>>> P.s As I am a master student, this is my first ever EEG study and during
>>> the design of my experiment these differences between triggers coding did
>>> not occur to me...
>>> _______________________________________________
>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>> To unsubscribe, send an empty email to
>>> eeglablist-unsubscribe at sccn.ucsd.edu
>>> For digest mode, send an email with the subject "set digest mime" to
>>> eeglablist-request at sccn.ucsd.edu
>>>
>>
>>
>> --
>> Makoto Miyakoshi
>> Swartz Center for Computational Neuroscience
>> Institute for Neural Computation, University of California San Diego
>>
>>
>>
>>
>

-- 
Makoto Miyakoshi
Swartz Center for Computational Neuroscience
Institute for Neural Computation, University of California San Diego
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20180717/04ecf285/attachment.html>


More information about the eeglablist mailing list