[Eeglablist] How to save EEG values with artifact ICs removed

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


Hi Samuel,

If you follow my instructions it should work. When you remove the components from the data with Tools > Remove components from data, the actual data are transformed. When you save your file, the signal will be considered as raw data. You can test this by plotting one channel before and after, without using EEGLAB functions to be sure.
For example:
% Run ICA and tag bad components
figure; plot(EEG.data(1,1:EEG.srate*10)); hold on; % plot 10 s of data from a frontal channel before removing (make sure to take a channel and period where you can see large eye blinks here to see the difference clearly)
% Remove them (Tools > Remove components)
plot(EEG.data(1,1:EEG.srate*10)); legend('raw', 'after removing components'); % plot again and compare visually

Cedric

------- Original Message -------
On Tuesday, April 25th, 2023 at 2:01 AM, Samuel Armstrong <samuel.armstrong at uq.edu.au> wrote:

> Hi Cedric,
>
> Thanks again for getting back to me. This is starting to seem a little like more of a Brainstorm question, but hear me out. Based on the comments in the Brainstorm forum (for e.g. see links below), “Brainstorm can’t import ICA decompositions from other programs. The only thing you can do is import pre-processed files, which are handled as ‘raw’ files. In this ccase, you need to make sure the EEG values have been saved with the artefact IC removed.’
>
> https://urldefense.com/v3/__https://neuroimage.usc.edu/forums/t/ica-components-into-brainstorm/35637/2__;!!Mih3wA!DN_syCMtDVaV9m03QAAMKbUFDicwFcuKdDeo7EVKP1CB4J6r83IROihcfQRGXtzfW0LBn3g8ViX3qGrU0sMdu8Ns3g$ 
>
> https://urldefense.com/v3/__https://neuroimage.usc.edu/forums/t/ica-weights-in-file/35991__;!!Mih3wA!DN_syCMtDVaV9m03QAAMKbUFDicwFcuKdDeo7EVKP1CB4J6r83IROihcfQRGXtzfW0LBn3g8ViX3qGrU0sMuuqOcew$ 
>
> I’ve tried a few different ways to correct for this issue, however any artefacts that are removed using ICA in EEGlab will return when the dataset is imported into Brainstorm. However, given there are studies that have completed their preprocessing with ICA (to remove blinks etc) in EEGLAB and then exported the data into Brainstorm (see links below), I’m curious as to how this might be achieved. From what I can gather, unless you force EEGLAB to write the .set file with the ICA cleaning applied, the ICs would not be applied to the Brainstorm dataset, and thus the artefacts would still be present.
>
> https://urldefense.com/v3/__https://www.frontiersin.org/articles/10.3389/fnins.2018.00309/full__;!!Mih3wA!DN_syCMtDVaV9m03QAAMKbUFDicwFcuKdDeo7EVKP1CB4J6r83IROihcfQRGXtzfW0LBn3g8ViX3qGrU0sMh6WNrbA$ 
>
> https://urldefense.com/v3/__https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9226558/__;!!Mih3wA!DN_syCMtDVaV9m03QAAMKbUFDicwFcuKdDeo7EVKP1CB4J6r83IROihcfQRGXtzfW0LBn3g8ViX3qGrU0sPA_syELQ$ 
>
> Interested in any ideas people might have to solve this issue.
>
> Cheers,
>
> Sam
>
> --
>
> Sam Armstrong
>
> M +614 24 449 609
>
> Esamuel.armstrong at uq.edu.au
>
> From: Cedric Cannard <ccannard at protonmail.com>
> Date: Tuesday, 25 April 2023 at 1:23 pm
> To: Samuel Armstrong <samuel.armstrong at uq.edu.au>
> Subject: Re: [Eeglablist] How to save EEG values with artifact ICs removed
>
> Hi Samuel,
>
> Oh ok, in that case, simply substrate the bad components from your data, visually/manually (see here https://urldefense.com/v3/__https://eeglab.org/tutorials/06_RejectArtifacts/RunICA.html*studying-and-flagging-artifactual-ica-components__;Iw!!Mih3wA!DN_syCMtDVaV9m03QAAMKbUFDicwFcuKdDeo7EVKP1CB4J6r83IROihcfQRGXtzfW0LBn3g8ViX3qGrU0sMGl3PMLg$ )
>
> or automatically with ICLabel (see here: https://urldefense.com/v3/__https://eeglab.org/tutorials/06_RejectArtifacts/RunICA.html*subtracting-ica-components-from-data__;Iw!!Mih3wA!DN_syCMtDVaV9m03QAAMKbUFDicwFcuKdDeo7EVKP1CB4J6r83IROihcfQRGXtzfW0LBn3g8ViX3qGrU0sOx63CZ0w$ )
>
> Then save file as .set file, you should be able ton import the clean file in Brainstorm.
>
> Cedric
>
> On Mon, Apr 24, 2023 at 17:46, Samuel Armstrong <[samuel.armstrong at uq.edu.au](mailto:On%20Mon,%20Apr%2024,%202023%20at%2017:46,%20Samuel%20Armstrong%20%3c%3ca%20href=)> wrote:
>
>> Hi Cedric,
>>
>> Thanks for responding. I tried what you suggested, but didn’t achieve the outcome I was looking for, so I think my question was probably a little unclear.
>>
>> What I am trying to do is save the EEG set that contains data reflecting the ICartefact-subtracted values. I want to import my data into brainstorm… but since brainstorm doesn’t recognise the ICA weight matrices, I’m trying to figure out a work around.
>>
>> There appears to be papers available where people used EEGLAB to perform ICA on their data, and then subsequently import that data into Brainstorm, but I’m not sure how they managed to import artefact-corrected data since brainstorm doesn’t appear to recognise the ICA decomposition.
>>
>> Any ideas or suggestions?
>>
>> Cheers,
>>
>> Sam
>>
>> --
>>
>> Sam Armstrong
>>
>> M +614 24 449 609
>>
>> Esamuel.armstrong at uq.edu.au
>>
>> From: Cedric Cannard <ccannard at protonmail.com>
>> Date: Tuesday, 25 April 2023 at 4:57 am
>> To: Samuel Armstrong <samuel.armstrong at uq.edu.au>
>> Cc: EEGLAB List <eeglablist at sccn.ucsd.edu>
>> Subject: Re: [Eeglablist] How to save EEG values with artifact ICs removed
>>
>> Dear Sam,
>>
>> The official recommendations from the EEGLAB tutorial are to tag the bad components at subject level, and then remove them at the STUDY level (simply check the 2nd little box in the "Precompute measures" window, see here for example: https://urldefense.com/v3/__https://github.com/sccn/eeglab/issues__;!!Mih3wA!DN_syCMtDVaV9m03QAAMKbUFDicwFcuKdDeo7EVKP1CB4J6r83IROihcfQRGXtzfW0LBn3g8ViX3qGrU0sN1iHgVBg$ ).
>>
>> If you want to remove them for each file to inspect visually for example, simply save your .set file after doing so. Go to "File" > "Save current dataset as" > choose file name and destination and save.
>>
>> Then you import the .set files in your STUDY for group analysis. And don't check the little box if you already removed the bad components.
>>
>> Cedric
>>
>> ------- Original Message -------
>> On Monday, April 24th, 2023 at 12:59 AM, Samuel Armstrong via eeglablist <eeglablist at sccn.ucsd.edu> wrote:
>>
>>> Hello all,
>>>
>>> Ive had a bit of a search in the past topics, but can’t find anything, so Just after a bit of help with this one, please.
>>>
>>> I have a bunch of preprocessed data and I want to save these datasets so that the EEG values are permanently saved with the artefact ICs removed. Just wondering if anyone can suggest how I might be able to do this?
>>>
>>> Best,
>>>
>>> Sam
>>>
>>>
>>> --
>>> Sam Armstrong
>>> DipCWD, BPsych(Hons I), MPhil(CogNeuro)
>>> PhD Candidate
>>>
>>> Surgical Treatment and Rehabilitation Service (STARS)
>>> Herston Health Precinct
>>> Brisbane QLD 4029 Australia
>>>
>>> School of Psychology | School of Health and Rehabilitation Sciences
>>> The University of Queensland
>>> Brisbane Qld 4072 Australia
>>>
>>> M +614 24 449 609
>>> E samuel.armstrong at uq.edu.aumailto:samuel.armstrong at uq.edu.au
>>>
>>> W [https://urldefense.com/v3/__https://psychology.uq.edu.au__;!!Mih3wA!EaX3_HdC2Fsqp6r2jyErox-vCKF4u5BTP4-YhB7XoBAKlZKuRCcLACmp_GyrGl-OApyMs_ThpZilZY_XNd0qO0iKz7avrKst4udO$](https://urldefense.com/v3/__https:/psychology.uq.edu.au__;!!Mih3wA!EaX3_HdC2Fsqp6r2jyErox-vCKF4u5BTP4-YhB7XoBAKlZKuRCcLACmp_GyrGl-OApyMs_ThpZilZY_XNd0qO0iKz7avrKst4udO$)
>>>
>>> The University of Queensland (UQ) acknowledges the Traditional Owners and their custodianship of the lands on which UQ operates. We pay our respects to their Ancestors and their descendants, who continue cultural and spiritual connections to Country. We recognise their valuable contributions to Australian and global society.
>>>
>>> CRICOS 00025B • TEQSA PRV12080
>>>
>>> [signature_605933061]
>>>
>>> This email (including any attached files) is intended solely for the addressee and may contain confidential information of The University of Queensland. If you are not the addressee, you are notified that any transmission, distribution, printing or photocopying of this email is prohibited. If you have received this email in error, please delete and notify me. Unless explicitly stated, the opinions expressed in this email do not represent the official position of The University of Queensland.
>>> P Please consider the environment before printing this email
>>>
>>> Hello all,
>>>
>>> Ive had a bit of a search in the past topics, but can’t find anything, so Just after a bit of help with this one, please.
>>>
>>> I have a bunch of preprocessed data and I want to save these datasets so that the EEG values are permanently saved with the artefact ICs removed. Just wondering if anyone can suggest how I might be able to do this?
>>>
>>> Best,
>>>
>>> Sam
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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