[Eeglablist] Help with epoched dataset and trial removals

Jorge Delgado-Muñoz delgadojorge at g.ecc.u-tokyo.ac.jp
Mon Jan 22 01:04:28 PST 2024


Hello all,

I would like to know if there is any way to exclude a determined number of
trials from the whole .set data file.

I preprocessed and epoched the data using ERPLAB following the pipeline
proposed here:

https://urldefense.com/v3/__https://www.youtube.com/watch?v=ZvqMravgMQc&list=PLXlk-6FrkWTLS_O23DpPWw9BAqrBPyIXc__;!!Mih3wA!D54newP-j7-HqStqc6oGlYM6zyC6ehT8TCTBSMoL50fAHHvZbrTfRKRfPMJEGPzKNIyDcEYQR68WjGjOMsrm_svwbmpgSI9-MC1wDPc$ 

I performed trial rejection using Moving Window Peak to Peak and Step-like
artifact removal. This allows me to generate a new dataset with the
rejected trials marked.

I would like to generate a new dataset with those bad trials removed, so I
am using the following functions to remove them using a script:
reject_trials = find(EEG.reject.rejmanual)
% remove the fields in the EEG dataset to eliminate the trial
% information
EEG.data(:,:,reject_trials)=[];
% remove event data
EEG.event(reject_trials) = [];
EEG.epoch(reject_trials) = [];
EEG.reject.rejmanual(reject_trials) = [];
EEG.reject.rejmanualE(:,reject_trials) = [];
%save new dataset
EEG = pop_saveset( EEG, 'filename',fileName,'filepath',outputPath);
With this, I can generate a new .set file without the rejected data.
However, when I load this dataset file, the event information for some of
the remaining trials is not displayed when I plot the data. I might be
ignoring some information at the moment of editing the event and epoch
information, but I could not find exactly which. Even when I am sure that I
am removing the right trials, not having the epoch and event information
correctly synchronized may bring some inconveniences.

If someone can help me with this issue, I will be really grateful. Thank
you very much in advance.


Best Regards,

-- 

Jorge Delgado-Muñoz

Hiraki Lab

https://urldefense.com/v3/__https://ardbeg.c.u-tokyo.ac.jp/en/top-2/__;!!Mih3wA!D54newP-j7-HqStqc6oGlYM6zyC6ehT8TCTBSMoL50fAHHvZbrTfRKRfPMJEGPzKNIyDcEYQR68WjGjOMsrm_svwbmpgSI9-TR1FHvs$ 
<https://urldefense.com/v3/__https://eur03.safelinks.protection.outlook.com/?url=https*3A*2F*2Fardbeg.c.u-tokyo.ac.jp*2Fen*2Ftop-2*2F&data=04*7C01*7CYutaro.Hamasaki*40tobii.co.jp*7Ca7f9c067c478445bffd408d874055269*7C6b7dddeaad8f4522be45cb8e69a29a5a*7C0*7C0*7C637386913512066949*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C1000&sdata=qi4VdnXRljHwyiC0q5NyRgG5QgdI4ggqzFM2g8pe5*2Bw*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSU!!Mih3wA!D54newP-j7-HqStqc6oGlYM6zyC6ehT8TCTBSMoL50fAHHvZbrTfRKRfPMJEGPzKNIyDcEYQR68WjGjOMsrm_svwbmpgSI9-z10uV1E$ >

Department of General System Studies

Graduate School of Art and Science, The University of Tokyo
email:  delgadojorge at g.ecc.u-tokyo.ac.jp
            joardemu at gmail.com


More information about the eeglablist mailing list