<div dir="ltr"><div class="gmail_default"><p class="MsoNormal"><span style="font-size:10pt;font-family:Arial,sans-serif"><font color="#000000">Hello Fang-yu, Some notes are listed below I hope they are useful. All the best.</font></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:Arial,sans-serif"><font color="#000000"><br></font></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:Arial,sans-serif"><font color="#000000"><br></font></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:Arial,sans-serif"><font color="#000000"><br></font></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:Arial,sans-serif"><font color="#000000"><br></font></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:Arial,sans-serif"><font color="#000000">***********</font></span></p><p class="MsoNormal"><span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px">If you haven't had a chance to, </span>please<span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px"> try googling the </span>eeglab<span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px"> list for past useful discussions about your channel topic.</span><span style="font-size:10pt;font-family:Arial,sans-serif"><font color="#000000"><br></font></span></p><p class="MsoNormal"><font color="#000000"><span style="font-size:10pt;font-family:Arial,sans-serif">One can create a new channel and/or modify the labels within the EGI channel locations file or within eeglab. </span><span style="font-size:10pt;font-family:Arial,sans-serif">There's an example code snippet below you can modify and try. It takes a file that has 128 channels (after import from .raw EGI files with reference channel included) and </span></font><span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px">saves out a 129th interpolated channel at the Cz location</span><span style="color:rgb(0,0,0);font-size:10pt;font-family:Arial,sans-serif">. Using the gui or scripts, one </span><span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:10pt">needs to create a new channel or modify the Cz channel information (in Edit>Channel Locations) to be a real channel, and then interpolate via method of choice. </span><span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px">The code below needs an EGI channel locations text file where the Cz label on the last line is changed to E129. </span><span style="color:rgb(0,0,0);font-size:13.3333px;font-family:Arial,sans-serif">It's also a good idea to double-check and formally select which EGI channel locations file to use, as </span>eeglab<span style="color:rgb(0,0,0);font-size:13.3333px;font-family:Arial,sans-serif"> may not select the correct one. </span><span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px">Review of EEG.chanlocs and EEG.urchanlocs in the </span>eeglab<span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px"> data structure may also be useful, they are modified in the code snippet below. If you find a good solution please </span>let<span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px"> other </span>egi/eeglab <span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px">users on the list know. </span><span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px">Last, with the new file format from EGI (</span>mmf<span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px"> or </span>mff)<span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px"> this may no longer be any issue. </span></p><p class="MsoNormal" style="color:rgb(51,51,153)"><span style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13.3333px">***********</span><br></p><p class="MsoNormal" style="color:rgb(51,51,153)"><br></p><p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-size:10pt;font-family:Arial,sans-serif;color:forestgreen"><br></span></p><p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-size:10pt;font-family:Arial,sans-serif;color:forestgreen"><br></span></p><p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><br></font></p><p class="MsoNormal" style="color:rgb(51,51,153)"><br></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">thenameOfYourCurrenFile = </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">NAMEOFYOURFILE.set'</span><span style="font-family:Arial,sans-serif;color:black"> ; </span><span style="font-family:Arial,sans-serif;color:forestgreen">%this should be the name of a file that has 128 channels from -eeg data you have.</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">thenameofthe129ChanFiletobeLoaded = </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'GSN-HydroCel-129_cz_as_E129.sfp'</span><span style="font-family:Arial,sans-serif;color:black">; </span><span style="font-family:Arial,sans-serif;color:forestgreen">%this file should be in current directory, it is included in the email with this code</span><span style="font-family:Arial,sans-serif"></span></font></p><p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-family:Arial,sans-serif;color:forestgreen"><font size="1">%this file is the same text file except Cz is renamed to E129 within the text file on the last line.</font></span></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">directoryoffilethathas129ChannelFiletobeLoaded = cd;</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">currentdirectory = cd;</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">pathofyour129chanlocationsfile = cd;</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">filenameandpathofyour129channellocationsfile = [pathofyour129chanlocationsfile filesep thenameofthe129ChanFiletobeLoaded]</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">NameofnewfileToBeSavedoutwithCz = [EEG.filename(1:end-4) </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'_withCz'</span><span style="font-family:Arial,sans-serif;color:black">];</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-size:x-small;font-family:Arial,sans-serif;color:black"><br></span></p><p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-size:x-small;font-family:Arial,sans-serif;color:black">STUDY = []; CURRENTSTUDY = 0; ALLEEG = []; EEG=[]; CURRENTSET=[]; </span><span style="font-size:x-small;font-family:Arial,sans-serif;color:forestgreen">%empties memory</span><br></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">EEG = pop_loadset(</span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'filename'</span><span style="font-family:Arial,sans-serif;color:black">,thenameOfYourCurrenFile,</span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'filepath'</span><span style="font-family:Arial,sans-serif;color:black">,currentdirectory); </span><span style="font-family:Arial,sans-serif;color:forestgreen">%loads a 128 channel eeg file that needs an interpolated Cz</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0 ); </span><span style="font-family:Arial,sans-serif;color:forestgreen">%checks eeglab and stores current file</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">EEG.data(end+1,:) = 0; EEG.nbchan = size(EEG.data,1); </span><span style="font-family:Arial,sans-serif;color:forestgreen">%creates new empty row of time in EEG data</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:blue">if</span><span style="font-family:Arial,sans-serif;color:black"> ~isempty(EEG.chanlocs); EEG.chanlocs(end+1).label = </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'E129'</span><span style="font-family:Arial,sans-serif;color:black">; </span><span style="font-family:Arial,sans-serif;color:blue">end</span><span style="font-family:Arial,sans-serif;color:black">; </span><span style="font-family:Arial,sans-serif;color:forestgreen">%creates new chanloc row</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:blue">if</span><span style="font-family:Arial,sans-serif;color:black"> ~isempty(EEG.urchanlocs); EEG.urchanlocs(end+1).label = </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'E129'</span><span style="font-family:Arial,sans-serif;color:black">;</span><span style="font-family:Arial,sans-serif;color:blue">end</span><span style="font-family:Arial,sans-serif;color:black">; </span><span style="font-family:Arial,sans-serif;color:forestgreen">%creates new urchanloc row</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">[ALLEEG EEG CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET); eeglab </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">redraw</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">EEG.chanlocs(129).labels = </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'E129'</span><span style="font-family:Arial,sans-serif;color:black">; EEG.chanlocs(129).Y = 0;EEG.chanlocs(129).X = 5.4492e-16; </span><span style="font-family:Arial,sans-serif;color:forestgreen">%changes info in chanlocs, but not in urchanlocs</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">EEG.chanlocs(129).Z = 8.8992;EEG.chanlocs(129).sph_theta = 0;EEG.chanlocs(129).sph_phi = 90;</span><span style="font-family:Arial,sans-serif;color:forestgreen">%changes info in chanlocs, but not in urchanlocs</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">EEG.chanlocs(129).sph_radius = 8.8992;EEG.chanlocs(129).theta = 0;EEG.chanlocs(129).radius = 0;</span><span style="font-family:Arial,sans-serif;color:forestgreen">%changes info in chanlocs, but not in urchanlocs</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">EEG.chanlocs(129).type = </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">''</span><span style="font-family:Arial,sans-serif;color:black">;EEG.chanlocs(129).ref = </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">''</span><span style="font-family:Arial,sans-serif;color:black">;EEG.chanlocs(129).urchan = 129; </span></font></p><p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:forestgreen">%sets it to 132 automatically%changes info in chanlocs, but not in urchanlocs</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-family:Arial,sans-serif;color:black"><font size="1"><br></font></span></p><p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">eeglab </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">redraw</span><br></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-family:Arial,sans-serif;color:forestgreen"><font size="1"><br></font></span></p><p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:forestgreen">%loads the extra Cz information into channel 129</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">EEG=pop_chanedit(EEG, </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'load'</span><span style="font-family:Arial,sans-serif;color:black">,{filenameandpathofyour129channellocationsfile </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'filetype'</span><span style="font-family:Arial,sans-serif;color:black"> </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'autodetect'</span><span style="font-family:Arial,sans-serif;color:black">});</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET); EEG = eeg_checkset( EEG ); eeglab </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">redraw</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:forestgreen">%interpolates channel 129 using eeglab pop_interp function and spherical option</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">EEG = pop_interp(EEG, [129], </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'spherical'</span><span style="font-family:Arial,sans-serif;color:black">);</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">[ALLEEG EEG] = eeg_store(ALLEEG, EEG, CURRENTSET); EEG = eeg_checkset( EEG ); eeglab </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">redraw</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">EEG = pop_editset(EEG, </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'setname'</span><span style="font-family:Arial,sans-serif;color:black">, NameofnewfileToBeSavedoutwithCz);</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">EEG = pop_saveset( EEG,</span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'filename'</span><span style="font-family:Arial,sans-serif;color:black">, NameofnewfileToBeSavedoutwithCz,</span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">'filepath'</span><span style="font-family:Arial,sans-serif;color:black">, cd );</span><span style="font-family:Arial,sans-serif"></span></font></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><font size="1"><span style="font-family:Arial,sans-serif;color:black">[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, CURRENTSET); EEG = eeg_checkset( EEG ); eeglab </span><span style="font-family:Arial,sans-serif;color:rgb(160,32,240)">redraw</span></font><span style="font-size:12pt;font-family:Arial,sans-serif"></span></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-size:10pt;font-family:Arial,sans-serif;color:black"> </span><span style="font-size:12pt;font-family:Arial,sans-serif"></span></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-size:10pt;font-family:Arial,sans-serif;color:black"> </span><span style="font-size:12pt;font-family:Arial,sans-serif"></span></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-size:12pt;font-family:Arial,sans-serif"> </span></p>
<p class="MsoNormal" style="color:rgb(51,51,153)"><span style="font-family:Arial,sans-serif"> </span></p></div></div>