[Eeglablist] injecting ICA weights from one dataset to another

Ahmad, Jumana jumana.ahmad at kcl.ac.uk
Wed Jun 21 00:01:53 PDT 2017


Dear list,
Thank you for this useful thread which is very relevant to me. 
I wondered if the time series from the ICA training set needs to be exactly the same as the time series from the dataset you apply the weights to? 
Say on the dataset I applied the weights to I decided to delete more continuous data, or re- delete the continuous data with version 14 (to be sure I am not affected by the bug in the continuous rejection code), could I use my weights from the dataset already trained (in version 13, which could potentially now have different latencies for triggers or discrepancies in the continuous points rejected)? 
Sorry for asking such a simple question.
Thank you,
Jumana 

> On 26 May 2017, at 19:47, Andreas Widmann <widmann at uni-leipzig.de> wrote:
> 
> Hi Jose,
> 
>> I have no extensive experience with ICA. We do not include the EOG channels because we had bipolar EOG electrodes, and these EOG should be included as long as they are referenced together, right?
> There was a recent post by Arno on this issue:
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsccn.ucsd.edu%2Fpipermail%2Feeglablist%2F2017%2F012551.html&data=01%7C01%7Cjumana.ahmad%40kcl.ac.uk%7C06c3e922f53941b2faff08d4a467a5b0%7C8370cf1416f34c16b83c724071654356%7C0&sdata=8qTxHEdm51zmcZPyeiDO%2BIzzaNey3T7ApdZtxqc%2Bxco%3D&reserved=0
> 
> However, also see this somewhat older post :)
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsccn.ucsd.edu%2Fpipermail%2Feeglablist%2F2006%2F001452.html&data=01%7C01%7Cjumana.ahmad%40kcl.ac.uk%7C06c3e922f53941b2faff08d4a467a5b0%7C8370cf1416f34c16b83c724071654356%7C0&sdata=U8zNLMOCL0rhw5gYCToN4UGR1UqQlh9wSnnbsYAwBH4%3D&reserved=0
> 
> Personally, I would first try to include the bipolar EOG channels rather than no EOG channels at all and have a critical look at the decomposition. 
> 
>> Just for clarification regarding the ICA:
>> In Makoto's pipeline one can read: "the easy way to make the data full-ranked is to discard (any) one channel after average referencing. If you don't do this, ICA may return invalid results" it isn't correct? I think our confusion cames from here,
> Yes, but this channel(s) must also be excluded from the dataset you apply the ICA decomposition (as the bad channels). Personally, I prefer PCA instead of discarding channels.
> 
> Best,
> Andreas
> 
>> 
>> Also, since the ICA seems to run well with EOG channels included, doesn't really matter if the EOGs are bipolar electrodes?
>> 
>> Many thanks for your time,
>> 
>> Jose
>> 
>> On 26 May 2017 at 11:12, Andreas Widmann <widmann at uni-leipzig.de> wrote:
>> Hi Jose,
>> 
>>> I went to back to my pipeline.
>>> When I did ICA I set the rank to: all channels minus 3 (-1 due to the average reference and -2 due to both EOG channels)
>> One cannot "set" the rank. The rank is an inherent property of the data. What is the problem with your EOG channels? Most commonly it is recommended to include the EOG channels into ICA.
>> 
>>>    EEG = pop_runica(EEG, 'icatype', 'runica', 'extended', 1,'interupt', 'on','chanind', [1:EEG.nbchan-3]);
>> Using the 'chanind' option you define which channels should be included into the computation of the ICA decomposition. Thus, you excluded the last three channels from the decomposition. Why? You cannot apply the resulting decomposition to a dataset including these three channels. If you assume or know that your data are rank reduced you may use the 'pca' option of runica to reduce the dimensionality of the data. Excluding channels will not help.
>> 
>> Hope this helps! Best,
>> Andreas
>> 
>>> So, for a given subject the dimensions for the icachansind, icasphere, and icaweights variables were 1x63, 63x63 and 43x63 (so 66 [64 EEG channels + 2 EOG channels] -3). However, for this same subject the number of channels for the unfiltered dataset is 66. I think this is inconsistency is screwing up my data, however I don't know how this should be done to overcome my problem,
>>> Am 25.05.2017 um 15:22 schrieb José Luis <joseluisulloafulgeri at gmail.com>:
>>> 
>>> dear community,
>>> 
>>> I'm performing analysis of EEG data, which I want to explore for ERP and TF analysis. I aimed at performing two separated analyses, one with filtered data (for ERPs) and another with unfiltered data (for TF, also because I want to see high frequency oscillations),
>>> 
>>> I applied ICA to the filtered data to get ride of ocular and other artifacts. Next, I wanted to inject the weights of the ICA into the unfiltered data. Unfortunately I didn't find too much documentation about this, so I hope this will be useful for other users that want to do this (if there is any documentation please let me know).
>>> 
>>> What I did was the following:
>>> 1) In a first step I eliminated the bad components of my filtered data so I get an ICA-pruned dataset,
>>> 2) Next, I save the ICA variables from my ICA-pruned data set,
>>>    icachansind = EEG.icachansind;
>>>    icasphere = EEG.icasphere;
>>>    icaweights = EEG.icaweights;
>>> 3) Next, I load my unfiltered data. I make sure any bad channel that need to be removed was removed, and that the data was re-referenced to the average reference. I'm not certain that the average reference is very important, but regarding the bad channels I know that if I inject ICA weights from another dataset they need to have the same number of channels, so if I remove one channel when I perform ICA on the filtered data I need to remove one channel in the unfiltered data to apply the ICA weights. Next, I load the mat files that I save in step 2, and I edit the unfiltered dataset with:
>>>    EEG = pop_editset(EEG, 'icachansind', 'icachansind', 'icaweights', 'icaweights', 'icasphere', 'icasphere');
>>>    EEG = eeg_checkset(EEG);
>>> to integrate the ICA information in the unfiltered dataset. Next, I sort of apply the ICA decomposition with:
>>>    EEG = pop_subcomp(EEG, [ ], 0);
>>>    EEG = eeg_checkset(EEG);
>>> and this certainly eliminate the ocular movements of my unfiletered dataset,
>>> 4) Next, I interpolated if this is necessary with;
>>>    EEG = pop_interp(EEG, orichannels, 'spherical');
>>>    EEG = eeg_checkset(EEG);
>>> the orichannels correspond to the orginal arrangement of the EEG channels, and this works well to interpolate when there is a missing channel in the dataset,
>>> 5) Next, I re-reference to the average reference
>>>    EEG = pop_reref(EEG, [ ],'exclude', [65 66]);
>>>    EEG = eeg_checkset(EEG);
>>> 
>>> While all looks like it was working good, I noted that my unfiltered dataset was drastically changed. For some channels the amplitude of the signal was really diminished and looked like it was flat, but actually was just really diminished.
>>> 
>>> I went to back to my pipeline.
>>> When I did ICA I set the rank to: all channels minus 3 (-1 due to the average reference and -2 due to both EOG channels)
>>>    EEG = pop_runica(EEG, 'icatype', 'runica', 'extended', 1,'interupt', 'on','chanind', [1:EEG.nbchan-3]);
>>> 
>>> So, for a given subject the dimensions for the icachansind, icasphere, and icaweights variables were 1x63, 63x63 and 43x63 (so 66 [64 EEG channels + 2 EOG channels] -3). However, for this same subject the number of channels for the unfiltered dataset is 66. I think this is inconsistency is screwing up my data, however I don't know how this should be done to overcome my problem,
>>> 
>>> I find a message in the eeglab list about this but the procedure is not clear to me https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsccn.ucsd.edu%2Fpipermail%2Feeglablist%2F2013%2F006294.html&data=01%7C01%7Cjumana.ahmad%40kcl.ac.uk%7C06c3e922f53941b2faff08d4a467a5b0%7C8370cf1416f34c16b83c724071654356%7C0&sdata=jDzs1QnagUQtzJo1k6JHNjKUi%2F0KEIfpS0%2F00rkixpA%3D&reserved=0
>>> 
>>> I hope the description is good enough to show what my problem is,
>>> 
>>> Any directions about this will be really appreciated,
>>> 
>>> Jose
>>> _______________________________________________
>>> Eeglablist page: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsccn.ucsd.edu%2Feeglab%2Feeglabmail.html&data=01%7C01%7Cjumana.ahmad%40kcl.ac.uk%7C06c3e922f53941b2faff08d4a467a5b0%7C8370cf1416f34c16b83c724071654356%7C0&sdata=KvPpFzWNMpgZzBy30Xc2X9HlY25Raf9hVugc0xm1AqQ%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
>> 
>> 
>> 
>> 
>> -- 
>> José Luis ULLOA FULGERI, PhD
>> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsites.google.com%2Fsite%2Fjoseluisulloafulgeri%2F&data=01%7C01%7Cjumana.ahmad%40kcl.ac.uk%7C06c3e922f53941b2faff08d4a467a5b0%7C8370cf1416f34c16b83c724071654356%7C0&sdata=ZKsGpebUOBEp%2FWGlbfU5ozusrbjLoX5sbOCfyxob6j0%3D&reserved=0
>> +447516893093
> 
> _______________________________________________
> Eeglablist page: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fsccn.ucsd.edu%2Feeglab%2Feeglabmail.html&data=01%7C01%7Cjumana.ahmad%40kcl.ac.uk%7C06c3e922f53941b2faff08d4a467a5b0%7C8370cf1416f34c16b83c724071654356%7C0&sdata=KvPpFzWNMpgZzBy30Xc2X9HlY25Raf9hVugc0xm1AqQ%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