[Eeglablist] Using EEG.epoch(x).eventurevent & EEG.urevent(x).latency to get timepoint in original data of an epoch start

Luis Piloto lpiloto at Princeton.EDU
Wed Sep 12 12:56:04 PDT 2012


Hello everyone,

I'll try to be as brief as possible and I'd like to thank you in advance 
for the help.

I have 3 datasets:

dataset_a.set =  EEG file containing a .CNT file that was rereferenced / 
resampled (1000 Hz --> 250Hz) and has all of the events populated, with 
EEG.data of dimensions [21, 100000] i.e. 21 channels and 10000 
timepoints BUT the EEG.times field is empty

dataset_b.set = corresponds to an EEG dataset which was epoched (via 
pop_epoch()) from dataset_a for specific event(s) e.g. 
dataset_b.epoch(x).eventtype = {'31' '37'}

dataset_c.MAT = matrix with dimensions [21, 100000, 50] = (# channels, # 
timepoints, #frequencies) corresponding to wavelet decomposition of 
dataset_a for 50 frequencies

What I'm trying to do is utilize dataset_b to know which time points of 
dataset_a correspond to that particular epoch start to extract the 
relevant epoch data from dataset_c.  I'm currently using:

time_in_dataset_a = dataset_b.urevent( dataset_b.epoch(1).eventurevent( 
1 ) ).latency

I assumed if this was working correctly, I would get something like 
time_in_dataset_a =  1.004 seconds (assuming a sampling rate of 250 Hz = 
4 ms temporal resolution).  This would give me the 251st timepoint as 
the start of my epoch because 1.004 s * (250 timepoints per second) = 
timepoint 251.  However, when I use this, the resulting time is NOT a 
multiple of my temporal resolution and so it seems like I'm either doing 
something wrong or I've messed up my data in the epoching OR 
resampling.  Although I have looked at pop_resample.m and it does seem 
to recompute event latences as shown in the comment on top of the file 
"% 04-05-02 recompute event latencies -ad ".

I look forward to hearing from you guys -- been kinda stuck on this one.

Regards,
Luis Piloto



More information about the eeglablist mailing list