[Eeglablist] Manually epoch data

Cedric Cannard ccannard at protonmail.com
Tue Apr 18 12:12:25 PDT 2023


Hi Adam,

You could extrac epochs for these trials separately and export them in separate .set files. For example:

% Trial type 1
EEG = pop_epoch(EEG, {'marker1'}, [-0.1 10]);  % replace 'marker1' by your marker of interest and correspond length in seconds.
EEG = pop_saveset(EEG,'filepath', folderPath,'filename','filename_type1.set');

% Trial type 2
EEG = pop_epoch(EEG, {'marker2'}, [-0.1 30]);
EEG = pop_saveset(EEG,'filepath', folderPath,'filename','filename_type1.set');

Then, you import the .set files into a STUDY, edit the design to make sure you have the right conditions in your variables, and precompute your power spectra. You could also merge them instead of saving as separate files if you prefer (as long as you keep the markers in the data). 
Name them EEG1 and EEG2 in the example above, and merge with: 
EEG = pop_mergeset(EEG1, EEG2, 0); % note the 3rd input! will remove ICA information (set to 0) or preserve that from EEG1 but will recalculate EEG2 (if set to 1)! 

Hope this works!

Cedric



------- Original Message -------
On Monday, April 17th, 2023 at 11:45 PM, Adam Grinberg via eeglablist <eeglablist at sccn.ucsd.edu> wrote:


> Hi everyone.
> 
> I have a problem and I was wondering if it is even solvable using EEGLAB functions.
> 
> I have a dataset with several periods (trials) of interest. These periods are different in length and the events to start them are registered using an external system. I have all the timings and can easily create events in EEGLAB, corresponding to the beginning of the trials. However, I wish to epoch the data while creating a different duration for each trial. From what I see, the pop_epoch function can assign trials of a certain type only one duration. There is no option to create a different duration. I tried to manually change the "duration" field but it does not work.
> 
> What I eventually need is to calculate PSD on these time-windows and then average the power values between trials.
> 
> I appreciate the help in advance!
> 
> /Adam
> ______________________________________________________________________________________
> Adam Grinberg, PT, PhD
> Department of Community Medicine and Rehabilitation, Physiotherapy
> Umeå University
> Umeå, Sweden
> Tel: +46 (0) 90 786 96 30
> 
> _______________________________________________
> 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



More information about the eeglablist mailing list