Hoffman2:MATLAB:EEGLAB: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 45: | Line 45: | ||
# When EEGLAB finishes importing your data ''Done'' will appear above the command line. | # When EEGLAB finishes importing your data ''Done'' will appear above the command line. | ||
# At this time, do any preprocessing you'd like on the data in EEGLAB/MATLAB. | # At this time, do any preprocessing you'd like on the data in EEGLAB/MATLAB. | ||
# | # Add this special directory to your MATLAB path, | ||
#: <pre>>> /u/home/FMRI/apps/examples/binica/prep4binica(ALLEEG.data, ALLEEG.nbchan*ALLEEG.pnts, 'verbose', 'on', 'filenum', FILENAME);</pre> | #: <pre>>> addpath('/u/home/FMRI/apps/examples/binica');</pre> | ||
# Use the command, | |||
#: <pre>>> prep4binica(ALLEEG.data, ALLEEG.nbchan*ALLEEG.pnts, 'verbose', 'on', 'filenum', FILENAME);</pre> | |||
# This will save out the necessary files to run ICA: | # This will save out the necessary files to run ICA: | ||
#* data in a float-point file, ''.fdt'' | #* data in a float-point file, ''.fdt'' |
Revision as of 00:41, 19 April 2012
The three of the most recent versions of EEGLAB are maintained on Hoffman2 for the FMRI group in the directory
/u/home/FMRI/apps/eeglab
Adding EEGLAB to your MATLAB path
Choose one of the versions from
/u/home/FMRI/apps/eeglab
and add it to your MATLAB path by doing.
- Start MATLAB on Hoffman2
- Go to
- "File" > "Set Path..."
- Click "Add with Subfolders..."
- Navigate to
/u/home/FMRI/apps/eeglab
- choose which version you'd like to use and click on it.
- Click "Ok"
- To save this for future sessions, click "Save."
- If you don't want to save this path, click "Close" and then click "No" on the window that pops up.
- Go to the MATLAB command line and start EEGLAB by typing
>> eeglab
binica
If you want to run ICA decomposition on your data, it can often be a very time-intensive process. Doing this through the EEGLAB GUI (runica) is almost an order of magnitude slower than doing it with binica
or via command line. So let's walk through how to do this the fastest (most parallelizable) way by submitting jobs on Hoffman2.
Export your data from NetStation
- If you are going to preprocess your data in NetStation, do so first.
- Export your data in the NetStation simple binary format which produces files with the .raw extension. Upload this to Hoffman2 by your choice method.
Prep your data for ICA
- Start up MATLAB on Hoffman2 and start EEGLAB
- Go to
- "File" > "Import data" > "From Netstation binary simple file"
- Find your .raw file and select it.
- Click "Ok" on the first pop up window, and in the second give your dataset a name before clicking "Ok.""
- When EEGLAB finishes importing your data Done will appear above the command line.
- At this time, do any preprocessing you'd like on the data in EEGLAB/MATLAB.
- Add this special directory to your MATLAB path,
>> addpath('/u/home/FMRI/apps/examples/binica');
- Use the command,
>> prep4binica(ALLEEG.data, ALLEEG.nbchan*ALLEEG.pnts, 'verbose', 'on', 'filenum', FILENAME);
- This will save out the necessary files to run ICA:
- data in a float-point file, .fdt
- parameters for ICA in a configuration file, .sc
- Exit out of EEGLAB ("File" > "Quit").
- Exit out of MATLAB
Run ICA
If you prepared multiple datasets for ICA, you could submit many jobs in parallel to speed up the processing time.
- Use a text editor to make a script (e.g. icaScript.sh) on Hoffman2 with the following contents
#!/bin/bash /u/home/FMRI/apps/eeglab/current/functions/resources/ica_linux < path/to/sc/file
- where you replace /path/to/sc/file with the full path to the .sc file created by
prep4binica
.
- Make the script executable
chmod 750 /path/to/script
- replacing /path/to/script with the path to your script file.
- Submit this script as a job, we recommend demanding at least 12 hours and 2GB of RAM for your job.
- Wait for the script to complete.
Import ICA data back to EEGLAB
- Start up MATLAB on Hoffman2 and start EEGLAB
- Go to
- "File" > "Import data" > "From Netstation binary simple file"
- Find your .raw file and select it.
- Click "Ok" on the first pop up window, and in the second give your dataset a name before clicking "Ok.""
- When EEGLAB finishes importing your data Done will appear above the command line.
- Go to
- "Edit" > "Dataset into"
- Click "Browse" next to "ICA weights array or text/binary file (if any):" and find the ICA weight file (.wts extension).
- Click "Browse" next to "ICA sphere array or text/binary file (if any):" and find the ICA sphere file (.sph extension).
- Click "Ok".
- You should now be able to view the ICA information within EEGLAB.