<div dir="ltr"><div class="gmail_default" style="color:rgb(51,51,153)">Greetings Muhammad, This should get easy to do once you have the hang of it :0</div><div class="gmail_default" style="color:rgb(51,51,153)">Here are some notes below that you might find useful. Best wishes for your new year!</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 class="gmail_default" style="color:rgb(51,51,153)">****************************************</div><div class="gmail_default" style="color:rgb(51,51,153)">1. If you haven't had a chance to, try looking through the tutorial wiki on EEGLAB scripting, as well as related slides and talks from the EEGLAB schools. There should be some good ideas to help you there. Further, there is some basic matlab familiarity that is required to do scripting in eeglab. For example, see the "relevant Reading and Materials" section of a recent EEGLAB Summer School: <a href="http://sccn.ucsd.edu/wiki/EEGLAB_2014_Rio">http://sccn.ucsd.edu/wiki/EEGLAB_2014_Rio</a></div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div><div class="gmail_default" style="color:rgb(51,51,153)">2. For doing what you need to 80 files, you could consider the eeglab BATCH plugin from Desjardins.</div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div><div class="gmail_default" style="color:rgb(51,51,153)">3. For looping through files, you basically need to setup a list of all the files names, and then create a loop that, for each file, opens it with the correct commands and settings, does what ever steps and saves you want - again using the correct commands and settings, and then restarts the loop to start working on the next file. The loop should begin with an import of the file, and then should end with a save of the file (with any changes to the filename that you need, etc…]. </div><div class="gmail_default" style="color:rgb(51,51,153)">so for example things would look like this, generally [this is a very simple example of course!]</div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div><div class="gmail_default" style="color:rgb(51,51,153)">**********</div><div class="gmail_default" style="color:rgb(51,51,153)">for MuhammadLoop = 1: (length(MuhammadFileNames))</div><div class="gmail_default" style="color:rgb(51,51,153)">theCurrentFile = MuhammadFileNames(MuhammadLoop)</div><div class="gmail_default" style="color:rgb(51,51,153)">…import and do stuff here to theCurrentFile</div><div class="gmail_default" style="color:rgb(51,51,153)">…save theCurrentFile's new version</div><div class="gmail_default" style="color:rgb(51,51,153)">…clear all EEG datasets</div><div class="gmail_default" style="color:rgb(51,51,153)">end</div><div class="gmail_default" style="color:rgb(51,51,153)">***********</div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div><div class="gmail_default" style="color:rgb(51,51,153)">4. If you can do a step through the GUI, then most or all of the information you need to run that step as a script can be gotten through eegh (eeglab history). Closely review and imitate the information you get from there. In most cases, try to repeat exactly what the eeglab history says, rather than skipping any steps (until you know which ones you can skip :) For basic users, usually all the information needed is in eegh. </div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div><div class="gmail_default" style="color:rgb(51,51,153)">5. I would generally recommend first getting your files all in eeglab format, and then doing whatever series of steps you want on them. So have an "import" loop, and then a "processing" loop. I would also recommend steps in your loop where you change the string of the file name, and edit the set information as necessary.</div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div><div class="gmail_default" style="color:rgb(51,51,153)">6. You do need a little familiarity with matlab. For example, as might guess, you will have to, for each file loop in your script, have a variable name that is "theCurrentFile". If you need to, for any basic matlab functions or questions, such as to get a file directory, please also try searching for your topic and "Matlab". e.g., Search on google: "get directory of files names matlab" </div><div class="gmail_default" style="color:rgb(51,51,153)"><br></div><div class="gmail_default" style="color:rgb(51,51,153)"><h5 style="color:rgb(0,0,0);background-image:none;margin:0px 0px 0.3em;overflow:hidden;padding-top:0.5em;padding-bottom:0.17em;border-bottom-style:none;font-size:13px;font-family:sans-serif;line-height:19px"><br></h5></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 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">On Thu, Jan 1, 2015 at 11:11 PM, Muhammad Adeel Parvaz <span dir="ltr"><<a href="mailto:mparvaz@gmail.com" target="_blank">mparvaz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I am new to EEGLAB. I have an EEG data (.mat) that I can successfully import it in EEGLAB, use the last channel (#65) to load events and then save the data as a .set and .fdt pair. However, I have about 80 of these files and I would like to repeat these 3 processes to each of these files. I looked into doing it through GUI on the first file and then using the dataset history to get the commands for each step and applying to other files, but I am not quite sure how to do that.</div><div><br></div><div>By the way, I can manually import a bunch of files and then run the history commands to automatically perform the other two steps. So, the automatic import seems to be the limiting factor. I would ideally like the script to run through the directory and perform these steps on each file.</div><div><br></div><div>My command history for one dataset looks like this:</div><div><br></div><div>pop_read_gtec(ALLEEG) % importing function supplied by the vendor</div><div>EEG = eeg_checkset( EEG );</div><div>EEG = pop_chanevent(EEG, 65,'edge','leading','edgelen',0);</div><div>EEG = eeg_checkset( EEG );</div><div>EEG = pop_saveset( EEG, 'filename','S001_Oddball.set','filepath','C:\\Users\\Documents\\MATLABfiles\\EEG_Data\\Test\\');</div><div>EEG = eeg_checkset( EEG ); </div><div><br></div><div>Any and every help would be much appreciated.</div><div><br></div><div>Thanks and a happy new year!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Muhammad </div></font></span></div>
<br>_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a><br></blockquote></div><br></div>