[Eeglablist] Manually epoch data

Adam Grinberg adam.grinberg at umu.se
Tue Apr 18 21:38:33 PDT 2023


Thank you all for your help!

As for now, three people said that the solution to my problem is to save each trial as a different dataset. That's what I will do!

Much appreciated!

/Adam
______________________________________________________________________________________
Adam Grinberg, PT, PhD
Department of Community Medicine and Rehabilitation, Physiotherapy
Umeå University
Umeå, Sweden
Tel: +46 (0) 90 786 96 30

-----Original Message-----
From: Cedric Cannard <ccannard at protonmail.com> 
Sent: 18 April 2023 21:12
To: Adam Grinberg <adam.grinberg at umu.se>
Cc: eeglablist at sccn.ucsd.edu
Subject: Re: [Eeglablist] Manually epoch data

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: 
> https://urldefense.com/v3/__https://eur01.safelinks.protection.outlook.com/?url=http*3A*2F*2Fsccn__;JSUl!!Mih3wA!CPWbdDt6eKXloTB2IXfB8MHmw5xh4sX9wVSI7bkd4tXnB_l0uqTc6bbmenPThRpjjXH-zdD9aOdKMHkvnpf6jd2wkyxZ$ .
> ucsd.edu%2Feeglab%2Feeglabmail.html&data=05%7C01%7Cadam.grinberg%40umu
> .se%7C47d63b13804c49a9fd5908db4040dc82%7C5a4ba6f9f5314f329467398f19e69
> de4%7C0%7C0%7C638174419584425677%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wL
> jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&
> sdata=luNqFhvaSrEeyONk5%2BsPOWb62WB%2FIZZPhrJ3GjtOd6w%3D&reserved=0
> 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