<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Baris,<div><br></div><div>1 - indeed there was a problem showing the reference when multiple references were used. This has now been corrected.</div><div><br></div><div>2,3 - no ICA does not need the location of the electrodes and does not need to know the reference either. The location of the electrode is important for plotting ICA components as well as data channels. If you use Cz as a reference while recording and then you compute an average reference, you can recompute the potential at Cz under the average reference assumption (see EEGLAB tutorial for more details). So having the location of Cz (the reference) is important.</div><div><br></div><div>4 - the ICA computation is (or at least should be) independent of the reference selected. This means that ICA should find the unmixing matrix to separate artifact and brain sources irrespective of the reference you are choosing. However, the exact solution returned by ICA depends on the reference you are using. This is why it is important to re-rerefence the ICA unmixing matrix as well. In practice you should rereference your data before computing ICA. However, in some case, for some reason you might want to rereference after ICA and in this case, the unmixing matrix must be rereference as well.</div><div><br></div><div>Hope this makes sense,</div><div><br></div><div>Arno</div><div><br></div><div><div><div>On Mar 16, 2011, at 3:55 AM, Baris Demiral wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Dear Arno,<div><br></div><div>I understand the fact that eeglab pop_reref function is more elaborate than the other scripts (and I know that this script is only a bit of the iceberg that you work on in order to make the eeglab structure coherent). I have a number of points to make (please correct me where ever I am wrong):<br>
<br></div><div>1- If we use other referencing scripts (pop_biosig etc), EEGLAB cannot detect the reference chosen (and cannot write it to the interface dialog box for instance.) Interestingly, if you use multiple references in the EEGLAB's pop_reref function, eeglab still cannot show them and leaves the reference information as "unknown". Only when you define a single electrode in pop_reref, it registers it into the eeg structure. But, this is not a big deal, we can live with that .</div>
<div><br></div><div>2- I assume that you developed the pop_reref script for a scenario where researchers may also want to re-reference eeg data later in the process, maybe after ICA decompositions are computed. I generally finish re-referencing at the very beginning of the preprocessing steps so I do not need that (I have not needed this yet but I may in future). See the comment below:</div>
<div><br></div><div>3- I acknowledge the fact that ICA needs the locations of all the electrodes to be fed for the ICA decomposition. Assume you used M1 and M2 for (re-)referencing (before the ICA computation without defining their location), and then take these electrodes (and other outer EOGs) out before the ICA computations, this would be fine, would not it? ICA does not need the reference electrode to be defined in this case. </div>
<div><br></div><div>4- I cannot understand why re-referencing would need to re-reference the ICA matrix. ICA components should be independent of the references selected (aren't they?) I am afraid this issue will take a very complicated phase in the discussion... </div>
<div><br></div><div>Thanks,</div><div>Baris<br><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Tue, Mar 15, 2011 at 5:23 AM, Arnaud Delorme <span dir="ltr"><<a href="mailto:arno@ucsd.edu">arno@ucsd.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">Dear Baris,<div><br></div><div>I have just tested referencing using two electrodes in EEGLAB and it works like a charm both from the GUI and from the command line.</div>
<div><br></div><div>Your problem might be that M1 is the current reference and want to reference to M1 and M2 (linked mastoids).</div><div>You first need to declare M1 as the reference, then compute average reference and include (recompute) M1. Then you can reference using M1 and M2. It is a little convoluted in this specific case, I agree. The entire process is described in the tutorial (it is a recent addition).</div>
<div><br></div><div><a href="http://sccn.ucsd.edu/wiki/Chapter_04:_Preprocessing_Tools#Re-referencing_the_data" target="_blank">http://sccn.ucsd.edu/wiki/Chapter_04:_Preprocessing_Tools#Re-referencing_the_data</a></div><div>
<br></div><div>Note that David's command does not reference the ICA matrix, does not allow to exclude channels, and does not update the channel location structure so it is better to use the official EEGLAB function. If you still have problems, please do not hesitate to submit a bug report (<a href="http://sccn.ucsd.edu/eeglab/bugzilla" target="_blank">http://sccn.ucsd.edu/eeglab/bugzilla</a>) detailing how to reproduce it.</div>
<div><br></div><div>Best regards,</div><div><br></div><div>Arno</div><div><br></div><div>ps: note that Tom's bug report was unrelated. We have fixed the issue.</div><div class="im"><div><br><div><div>On Mar 12, 2011, at 10:35 AM, Baris Demiral wrote:</div>
<br><blockquote type="cite">Since I use biosig to import bdf files, and biosemi bdf needs a reference while importing (to preserve some power), I am fine as soon as the biosig function works fine. <div><br></div><div>What I can suggest to other people is the following: </div>
<div><br></div><div>If you have already recorded your eeg with a reference electrode in the montage, and you just need to re-reference the data so that "the eeg data will have the reference to the average of the two electrodes", you can use David Groppe's script. </div>
<div><br></div><div>In his function there is a line:</div><div><span style="font-family:Times"><pre style="word-wrap:break-word;white-space:pre-wrap">data_avg=data_in2-repmat(data_in2(mastoid_id,:),size(data_in,1),1)/2;</pre>
</span><span style="font-family:Times">
</span><span style="font-family:Times"><pre style="word-wrap:break-word;white-space:pre-wrap">Since in the input file of this script, the first reference electrode would have a value of "0", the last piece of code at the end of data_avg above (divided by 2) will mean to take the half of the value of the new reference electrode row and subtract it from all other data matrix without explicitly defining the first reference (because its value would be 0 any ways). This will mean to "re-referencing the data to the mean/average of the two electrodes". </pre>
</span><span style="font-family:Times">
</span><span style="font-family:Times"><pre style="word-wrap:break-word;white-space:pre-wrap">If you had a grand average reference or similar montage in which you did not have an electrode with a value 0 during the recording, and you need to reference the data directly to one electrode: you can use the same script and just take out the "divided by 2" part. This will reference everything to the electrode you define. Is this right David? </pre>
</span><span style="font-family:Times">
</span>Baris</div></blockquote></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br>SB Demiral, PhD.<br>Department of Psychology <br>7 George Square<br>The University of Edinburgh<br>Edinburgh, EH8 9JZ<br>
UK<br>Phone: +44 (0131) 6503063<br>
</div>
</blockquote></div><br></div></body></html>