erplab icon indicating copy to clipboard operation
erplab copied to clipboard

overlapping event latency in epoch2continuous

Open anomalosepia opened this issue 6 years ago • 2 comments

Description

I don't think that this has been raised yet. If you are converting epoched to continuous and there are events with the same latency in the EEG.event.latency, you lose all but the first event (in the order in the latency struct) during the conversion. This is silent and doesn't raise errors or warnings.

]


#### Steps to Reproduce
  1. Get some continuous data with event structure that looks something like below. This is from EGI netstation so the data can get kind of mangled along the way.
duration type latency epoch urevent
600 Scrt' 99601 167 602
1 rscrt' 99685 167 603
0 'TRSP' 100193 167 604
0 'TRSP' 100201 168 605
600 'Fix' 100201 168 606
0 'bgin' 100274 168 607
0 'fix+' 100284 168 608
  1. run this on your data EEG = epoch2continuous(EEG)

  2. the resulting structure will not have the 'Fix' event at 100201 because line 27 in epoch2continuous only takes the first event at any given latency

[xlat, indx] = unique_bc2([EEG.event.latency], 'first');

in my case I was able to change that to

[xlat, indx] = unique_bc2([EEG.event.latency], 'last');

but that's only for the very narrow case of the data that I have here.


#### Expected behavior: I expected all the events to carry over from the epoched data to the continuous, with boundary event. data
#### Actual behavior: Only the first event comes over.
#### Versions
OS version mac os x catalina
Matlab version 2018b
EEGLAB version 2019.1
ERPLAB version 7.0

anomalosepia avatar Feb 14 '20 14:02 anomalosepia

Thanks for reporting this bug with epoch2continuous.

I'll take a look at this.

andrewxstewart avatar Feb 14 '20 22:02 andrewxstewart

Thank you! I just removed the requirement for unique latencies and it seems to be sorted out. Still checking though. A

Sent from my iPhone

On Feb 14, 2020, at 5:42 PM, Andrew X Stewart [email protected] wrote:

 Thanks for reporting this bug with epoch2continuous.

I'll take a look at this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

anomalosepia avatar Feb 14 '20 23:02 anomalosepia