<div dir="auto"><div>hi Tarik,</div><div dir="auto">thanks. Following  Makoto's pipeline and your suggestion, I first loaded a dataset with all chans saved the EEG variable with a different name , e.g. originalEEG.</div><div dir="auto"> Then I start my subjects' loop in which I load each dataset and then run : pop_interp(EEG,originalEEG.chanlocs, 'spherical') . </div><div dir="auto">This seem to work fine <br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Feb 10, 2017 1:02 AM, "Tarik S Bel-Bahar" <<a href="mailto:tarikbelbahar@gmail.com">tarikbelbahar@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="color:rgb(51,51,153)">Hello Gorka, it should be as easy as the following, though it's a simple approach:</div><div class="gmail_default" style="color:rgb(51,51,153)">loading a first file with the removed channels missing</div><div class="gmail_default" style="color:rgb(51,51,153)">and then loading a second file that has all the original channels </div><div class="gmail_default" style="color:rgb(51,51,153)">and then run interpolate from the GUI, to "fill out the missing channels in the first file based on the full channels from the second file". </div><div class="gmail_default" style="color:rgb(51,51,153)">Then review the commands that were run from eegh.</div><div class="gmail_default" style="color:rgb(51,51,153)">You may want to play around with the different options in the gui and view the different results.</div><div class="gmail_default" style="color:rgb(51,51,153)">Use the modified commands based on eegh in your loop, and make adjustments in your codelet as necessary.</div><div class="gmail_default" style="color:rgb(51,51,153)">You might need to reload the "all-channels" file each time you want to interpolate.</div><div class="gmail_default" style="color:rgb(51,51,153)">If you're matlab saavy, one can use the Urchannel locations information to rebuild original channels too.</div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div class="elided-text">On Mon, Feb 6, 2017 at 7:24 PM, Gorka FG <span dir="ltr"><<a href="mailto:gorkafraga@gmail.com" target="_blank">gorkafraga@gmail.com</a>></span> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text"><div dir="ltr"><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif"><span style="font-family:arial,sans-serif">Dear all, </span><br></div><div class="gmail_default"><br></div><div class="gmail_default">I have a dataset in which bad channels were manually removed using  EEG = pop_select (EEG, 'channel', <i>chans2keep</i>). In later steps, I was unable to interpolate those removed channels so I did a workaround inserting blank channels and then interpolating (see below). </div><div class="gmail_default">Would this approach be correct? am I missing a more simple way of doing this using pop_interp? </div><div class="gmail_default"><br></div><div class="gmail_default">Thanks in advance for the help! <br>Gorka</div><div class="gmail_default"><br></div><div class="gmail_default"><i>--</i></div><div class="gmail_default">%insert blank channels using <i>insertrows</i> <i> </i>( <a href="http://nl.mathworks.com/matlabcentral/fileexchange/9984-insertrows-a-b-ind-" target="_blank">http://nl.<wbr>mathworks.com/matlabcentral/fi<wbr>leexchange/9984-insertrows-a-<wbr>b-ind-</a>)  in each trial:</div><div class="gmail_default"><font face="times new roman, serif">    </font><font face="arial, helvetica, sans-serif">   </font><span style="font-family:arial,helvetica,sans-serif">for trial = 1:size(EEG.data,3); % loop thru trials</span></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">            tmp= EEG.data(:,:,trial);</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">              for c = 1:length(chans2interpNum); % loop thru indexes of channels to interpolate</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">                  tmp= insertrows(tmp,zeros(1,size(EE<wbr>G.data,2))],chans2interpNum(c)<wbr>-1); %insert a row of zeros at chan index position<br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">              end</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">            newEEG(:,:,trial) = tmp; </font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">            clear tmp</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">       end</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">       EEG.data = newEEG;<font color="#000000" size="3"> </font></font></div><div class="gmail_default">%interpolate: <br></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:"trebuchet ms",sans-serif">       </span><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)">EEG = eeg_checkset(EEG);</span><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><div class="gmail_default">        EEG = pop_chanedit(EEG,'load',chanlo<wbr>csfile,'besa');              </div><div class="gmail_default">           for c = 1:length(chans2interp);<br></div><div class="gmail_default">               EEG =pop_interp(EEG,chans2interpNu<wbr>m(c), 'spherical');</div><div class="gmail_default">           end</div><div class="gmail_default">         EEG = eeg_checkset(EEG);</div></font></div></div>
<br></div>______________________________<wbr>_________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/ee<wbr>glabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.uc<wbr>sd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">eeglablist-request@sccn.ucsd.e<wbr>du</a><br></blockquote></div><br></div>
</blockquote></div><br></div></div></div>