Test: Difference between revisions

From dok
No edit summary
Erstatter siden med «<rss>https://wiki.app.uib.no/info/all_wikis.rss</rss>»
Tag: Replaced
 
Line 1: Line 1:
==Preparing Files for Analysis==
<rss>https://wiki.app.uib.no/info/all_wikis.rss</rss>
* Connect to NeuroMus01: $ ssh -X NeuroMus01
* In your Experiment folder you need a folder "DataFiles".
  e.g. scr/neuromus##/EXPERIMENTS/'YourStudy'/DataFiles
* In this folder you create a subfolder for each participant
  e.g. scr/neuromus##/EXPERIMENTS/'YourStudy'/DataFiles/'experimentname_VP##'
* All these folders need to contain again a Subfolder "RawData"
  e.g. scr/neuromus##/EXPERIMENTS/'YourStudy'/DataFiles/'experimentname_VP##'/RawData
* Or you can type the following command to create the required number of folders and subfolders:
  $ for R in 1,2,...; do mkdir -p expName_sbj0${R}/RawData; done
* Copy the three eeg files for one participant into this folder "RawData", do that for each participant.
* Change file permissions for all eeg files from all participants. Go to your experiments directory and change permission and type:
  chmod -> find * -name *.[v,e][m,h,e][r,d,g]* -exec chmod 440 {} ";"  or 
  $ find * -name *.[v,e][m,h,e][r,d,g]* -exec chmod u=rwx,g=rwx,o=r {} ";"
 
  e.g.: (in command line)
  $ cd /scr/neuromus##/EXPERIMENTS/'YourStudy'/DataFiles
  $ find * -name *.[v,e][m,h,e][r,d,g]* -exec chmod 440 {} ";"Preparing Files for Analysis
 
==How to use the EEG analysis Script==
 
The script consists of several files. The file YourStudy.m is the main script (should have the name of the study from which you copied the files. E.g. DevDet.m, HiScore.m, …).
 
===Procedure of the Analysis (flowchart)===
 
 
===Prepare the Script===
 
Copy analysis script files and folders from a previous (similar is best) experiment and put in your 'scr/neuromus##/EXPERIMENTS/'YourStudy'/' folder. Rename main script to 'YourStudy', and rename the function within the script (first line of the file).
 
===DefSettings.m===
(Based on DefSettings.m from study DevDet)
The file DefSettings.m contains all settings for your analysis and has to be adapted to your needs. Within DefSettings.m, make sure the name of the study is correct again.
 
DefSettings is subdivided in different 'cases' which will be discussed in the following. Also have a look at the comments in the file DefSettings (depicted in green). They explain which values you have to choose.
 
Case 'S'
 
Settings.MthICA = '0';
 
* Change this value to 0 for processing your data with only an EOG correction (first step)
 
* Change this value to 1 for processing your data with ICA (to clean data in a second step)
 
Settings.RefChn = 'M1|M2';
 
* Should be your reference channels, normally M1 and M2 is correct
 
Case {'YourStudy', 'LoadData'}
 
Here you can find the filter settings that are used while loading your data. You don't have to change them unless your study does not need any special filter settings.
 
Case 'LoadRaw'
 
Settings.SettFIR
 
* again specifies some filters
<tt>Settings.CutTRG  =</tt>
{{{},                            [],  [], {'^0021$', '^0016$'},                2,  1};
 
{{'^0022$'},                      1,  1, {'^0022$', '^0016$'},                2,  1}; ...
 
{{'^0023$'},                      1,  1, {'^0023$', '^0016$'},                2,  1}; ...
 
{{'^0024$', '^0016$', '^0024$'},  1,  1,  {},                                [],  []}};
 
 
* Cuts out epochs that are not required for your analysis (like for example pauses)
 
* Epochs are always cut out from a certain trigger combination (green) to a certain trigger combination (red)
 
* If the brackets are empty like in the first line, epochs will be cut out from the beginning of the data file to a certain trigger combination (trigger 0021 followed by trigger 0016). Same holds for the last line. Empty brackets at the end means, that trigger are cut out from the trigger combination until the end.
 
* If your study does not require you to cut out any epochs, you can make a comment out of these lines (type '%' in front of each line). These lines will then not be processed.
 
 
Case 'DoRmBdCh'
 
Settings for the channel rejection (throw out bad channels), with settings for the plot and thresholds for the rejection. Does not have to be adapted unless you need special settings for your experiment.
 
 
Case 'DoManRej'
 
Settings for the manual rejection window. No changes.
 
 
Case 'DoClnEOG'
 
-No Changes.
 
 
Case 'DoSelCmp'
 
Settings for component rejection of the ICA. No changes.
 
 
Case 'DoRejAvr'
 
This function combines two steps, the automatic rejection and the calculation of the averages. Most of the variables do not have to be changed.
Settings.SelElc
 
* Specify all electrodes for the automatic rejection (all electrodes besides EOG channels and references)
 
Other parameters specify thresholds for the automatic rejection à no changes unless you need them
 
Settings.Sett4Avr
 
* Parameters for calculating averages
 
* There are two forms of this variable. Use the one with  the list to specify your conditions if you have only one experiment. If you have more than one experiment in your study choose the Settings.Sett4Avr variable with the 'if, elseif - loop'. Comment out the one you don't need for your study
 
* Fill in all trigger codes belonging to one condition that need to be averaged under one condition code
 
* Give a name for this condition under cond. Name (this name should not be too long)
 
* Set the epoch for this average (-0.2 to 1.2 should usually be fine, unless you are investigating later components)
 
* Set a baseline (-0.2 to 0.0 should usually be fine).  ATTENTION: Setting the baseline should be done before running STEP 5 (see table below). Changing the baseline after STEP 5 and running ExpGrdAgv will not make any change!
 
* Specify if there are triggers that need to be cut out before averaging (e.g. button presses). Do this in the last bracket: [1 2]
 
* All these information need to be specified for all conditions you want to average. Make sure that you always follow the syntax that is predefined for other experiments (don't forget brackets or ';' or '…'
Settings.TrgCutOut
 
* Specifies triggers that need to be cut out before averaging (for example button presses or stimuli from a cover task)
 
{triggers that need to be cut out, range between two triggers also possible}, [search range for the second trigger], [time to add if only one trigger is found], [time to add if both triggers are found]
 
* It is thus possible to cut out a stimulus followed by a button press, or to cut out a button press together with the 0.x seconds before the button press, etc.
 
Other parameters: no changes
 
 
Case 'ExpGrdAvg'
 
In case 'ExpGrdAvr', divide the conditions to facilitate any statistical comparison you may be interested in making.
 
Settings.ExpPfx
 
Fill in the prefix of your study (YourStudy)
 
Settings.ExpStt
 
Here you will find a matrix in which you can specify some parameters for the grand averages you want to calculate. The matrix has several rows, separated with a semicolon at the end of each line, and several columns, separated by comma in each line. The parameter belonging to a specific column is written above the matrix in green comments. Now the parameters you have to specify in each column will be explained.
 
* Specify the conditions that need to be averaged and compared under cond. Code (you need the condition codes you specified in Calc_AVR here)
 
* Specify SPSS codes (should be short, because these are a part of the variable names, otherwise variable names get too long)
 
* Specify which of the two conditions should be added and which should be subtracted (no changes)
 
* Specify the baseline (-200 to 0 should usually be fine)
 
* List all time windows you are interested in. For your first analysis you can leave them as they are to explore your data. In a second analysis you can specify time windows for your effect. If you have a time window of interest, based on previous research, you can just add it. Make a comma after the last time window and add your time window in brackets [ ].
 
* If you have more than one experiment, you can add the experiment name. Otherwise you leave this field empty --> ''
* Specify in which color the different conditions should be depicted in the figure. Specify a color for the condition that is added (e.g. 'r' for red), a color for the condition that is subtracted (e.g. 'b' for blue), and a colour for the difference wave (e.g. 'k' for black). --> {'r', 'b', 'k'}
You can also specify the line-width of the waveforms by adding it in a bracket after the color like this: {'r', 'b', {'k', 'linewidth', 2}}
Now the difference line should be depicted in black, with a line-width of 2.
 
If you want to use different colors or change other parameters for the lines you can find information about how to do it in the matlab documentation:
http://www.mathworks.de/de/help/matlab/ref/plot.html#inputarg_LineSpec
 
* Specify amplitude limits for your plots.
Specify the scale for your averages. [-6:2:12] would for example result in a scale from -6 to 12 in steps of 2.
Specify the amplitude limits for the headplots. Here you need one specification for each timewindow, and amplitude limits should always range from -x to x. So for example from -3 to 3 --> [-3 3].
Thus if you specified for example 5 different timewindows, and you want to set the amplitude limits for all headplots to -3 to 3, it should look like this:
{[-3 3], [-3 3], [-3 3], [-3 3], [-3 3]}
Settings.ExpElc
 
* Enter all electrodes that should be used to calculate the grand average (all electrodes besides EOG and reference channels)
Settings.ExpROI
 
* Specify your regions of interest
 
* If you need frontal left, frontal right, parietal left, parietal right, the settings should be fine
Settings.FigStt
 
Settings for the figures you want to export. Choose the ones you need or leave all in.
                      {{'lowpass', 10},              '__'; ...  % low-pass filtered 10 Hz, no running t-test
                      {},                            'UF'; ...  % data are unfiltered, no running t-test
                      {'lowpass', 10, 'alpha', 0.05}, 'T5'; ...  % low-pass filtered 10 Hz, running t-test (p < 0.05)
                      {'lowpass', 10, 'alpha', 0.01}, 'T1'};...  % low-pass filtered 10 Hz, running t-test (p < 0.01)
Settings.FigScp
* 1 = show / export figures with plots of the grand averages like the scalp position on the scalp; 0 = don't export
Settings.LimGrd
 
* define amplitude limits for the grand average scalp and array plots (otherwise they will be calculated from the data) --> for the scalp plots
Settings.FigArr
* 1 = show / export figures with plots of the grand averages in a rectangular array, 0 = don't export
Settings.ArrElc
 
* Specify electrodes for which the grand average should be depicted in the rectangular array figure.
Settings.LimGrd
 
* define amplitude limits for the grand average scalp and array plots (otherwise they will be calculated from the data) --> for the array plots
Settings.FigIdA
 
* 1 = show / export individual averages, 0 = don't export
Settings.PltIdA
 
* 'S' - scalp array, 'R' - rectangular array - takes the respective electrode settings defined above (ScpElc or ScpTyp and ArrElc or ArrTyp)
Settings.LimIdA
 
* define amplitude limits for the single subject averages (otherwise they will be calculated from the data)
Other parameters: no changes
 
 
Case 'N'
 
In case 'N', make sure that all of the subject data that you have are correctly named and arranged.
Settings = {'YourStudy_VP01', 'YourStudy_VP02'}
 
* All participants you want to process need to be specified here
 
* Make sure that they have the same name as the eeg files in your folder (case-sensitive)
 
* Any participants that need to be thrown out can be arranged next to the SubjRmvd header (which is made a comment by the '%') as well as an explanation for why the participant was removed.
 
===Run the Script===
 
* Start EEGLab (should be 'el' within terminal), and run on a computer with decent RAM or else it will be slow
 
* Change the directory to YourStudy directory by using :
 
>> cd /scr/neuromus##/EXPERIMENTS/'YourStudy'/
 
or:
 
>> cd /SCR/EXPERIMENTS/'YourStudy'/
 
* Run the Script by just calling the main script:
 
>> ProcessSubject
 
* You can call the ProcessSubject function with some arguments that are listed below
 
Interact = carry out processing steps requiring user interaction
      0  - carry out steps not requiring user interaction
      1  - carry out steps requiring user interaction
      2  - revise steps that were already carried out
 
ProcStep = carry out the following processing steps              (0-7, byte)
      1  - bad channel removal
      2  - manual rejections
      4  - component selection
(those can be combined, e.g., 3 would be the revision of bad channels and of manual rejections)
 
Here is the sequence of steps that you should follow:
 
<table style="width:100%"  border="1">
  <tr>
    <th>Description</th>
    <th>Command</th>
    <th>Output Files</th>
    <th>File Description</th>
  </tr>
  <tr>
    <td width="30%">STEP 1:  Call the script without interaction  Loading REFs, Filtered data, trigger file, channel locations</td>
    <td width="30%"> >> ProcessSubject(0) </td>
    <td width="20%">.set & .fdt</td>
    <td width="20%">.set:  contains information about the sampling rate, the subject Nr and the events  .fdt:  contains the data matrix, channels x sampling points. </td>   
  </tr>
  <tr>
    <td>  STEP 2:  Call the script with interaction  Manual rejection of bad channels/epochs, adjust the scale accordingly @ 200mV for Channel removal and @ 100mV for bad epochs. Criteria for bad channel removal [[BadChannels]]. Examples of bad epochs that should be removed: [[BadEpochs]].    </td>
    <td>  >> ProcessSubject(1) </td>
    <td> .rmc & .out </td>
    <td> .rmc:  contains the channel you selected for removal, which at a later point will be interpolated  .out:  contains the periods you manually selected for rejection </td>
  </tr>
  <tr>
    <td> <font color="red"> Procedure: ICA [MthICA = '1'] </font> </td> <td> </td> <td> </td> <td> </td>
  </tr>
  <tr>
    <td> STEP 3:  Non-Interactive Computation of ICA (binica)</td>
    <td>  >> ProcessSubject(0,NaN,'1') </td>
    <td> .ic1 </td>
    <td> .ic1:  binica </td>
  </tr>
  <tr>
    <td>  STEP 4: 
Call the script with interaction to remove bad components. [see section Criteria to remove ICA components further down for instructions.  NOTE: During data scrolling we might see noisy parts that we wouldn't expect given the fact that a manual rejection of bad epochs preceded. The reason is that in STEP 2 the data are filtered so that we remove only too noisy parts whereas in STEP 4 we see unfiltered data because ICA requires unfiltered data.  </td>
    <td>  >> ProcessSubject(1,4,'1')    >> ProcessSubject(1,255,'1') </td>
    <td> .sc1 </td>
    <td> .sc1:  contains information about which ICA components were manually selected for removal. We can copy the file .sc1 and rename it to file.mat and then we can load it from matlab to check the included components. </td>
  </tr>
  <tr>
    <td>STEP 5:  Non-Interactive  Filtering, rejecting epochs, averaging per condition and per subject</td>
    <td>  >> ProcessSubject(0,255,'1') </td>
    <td> .av1 </td>
    <td> .av1:  computed based on the files .ic1 & .av1 </td>
  </tr>
  <tr>
    <td>STEP 6:  Calculate Grand Averages </td>
    <td>  >> ExpGrdAvg('1') </td>
    <td> .dat  ...ArrERP___.eps  ...ArrERP_T1.eps  ...ArrERP_T5.eps  ...ArrERP_UF.eps  </td>
    <td>  .dat:  ta data file you need to import to SPSS in order to run the statistics  ...ArrERP___.eps: ERP plots (filtered for visualisation) in an array form  ...ArrERP_T1.eps: ERP plots (filtered for visualisation) in an array form with grey boxes for stat. sig. differences at p = 0.01    ...ArrERP_T5.eps:ERP plots (filtered for visualisation) in an array form with grey boxes for stat. sig. differences at p = 0.05    ...ArrERP_UF.eps: unfiltered ERP plots in an array form
All files are in the folder GrandAVR
</td>
  </tr>
  <tr>
  <tr>
    <td>  Optional Revision Steps </td> <td> </td> <td> </td> <td> </td>
  </tr>
  <tr>
    <td> Example 1:  Call the script to revise the manual bad channel rejection </td>
    <td>  >> ProcessSubject(2,1) </td>
    <td>  </td>
    <td>  </td>
  </tr>
<tr>
    <td>Example 2:  Call the script to revise the manual rejection  </td>
    <td>  >> ProcessSubject(2,2) </td>
    <td>  </td>
    <td>  </td>
  </tr>
<tr>
    <td> Example 3:  Call the script to revise manual rejection and bad channel removal </td>
    <td>  >> ProcessSubject(2,3) </td>
    <td>  </td>
    <td>  </td>
  </tr>
<tr>
    <td> Example 4:  Call the script to revise manual rejection and bad components </td>
    <td>  >> ProcessSubject(2,4,'1') </td>
    <td>  </td>
    <td>  </td>
  </tr>
  <tr>
    <td> <font color="red"> Procedure: EOG - Regression [MthICA = '9']</font></td> <td></td> <td></td> <td></td>
  </tr>
  <tr>
    <td>STEP 3:  Non-Interactive  Ocular Correction, "quick and dirty" method. Prototypical eye blinks and movements are computed and by using regression method it is deduced what has to be removed from the data. </td>
    <td>  >> ProcessSubject(0,NaN,'9') </td>
    <td> .av9  .eog </td>
    <td> .av9:  average    .eog  eye correction </td>
  </tr>
  <tr>
    <td>STEP 4:  Grand Averaging </td>
    <td>  >> ExpGrdAvg('9')  </td>
    <td> </td>
    <td> </td>
  </tr>
</table>
 
 
 
 
If you encounter an error while running any of the scripts, use function 'dbstop if error' to troubleshoot. This will open the script where the error was found and give an arrow on the problematic line. Make sure that all expressions are balanced and that there are no typos, there are the correct number of arguments for each function, and that each variable is properly assigned. Then try calling that script alone within the 'dbstop' shell to see if it runs. If not, look at the parameters for that script/the individual functions called to see where the problem may lie. If the problem is beyond your ability, ask another group member (not Sebastian, if possible) to see if they can help.
 
Also, if you find any errors in running the scripts, you can run each one of the scripts in the 'YourStudy' folder individually. In this way, you may be able to better identify what the specific problem entails.
 
 
===Redo steps===
 
If you want to redo steps (for example redo the manual rejection, because you think you did something wrong), please call the script with the »Revise« parameter (see help ProcessSubject for usage). The files that are created in the processing steps that follow the step you revised will be moved away (they have to be recalculated). You can check which steps have to be redone, with the file extensions corresponding to the specific steps that can be found in the flowchart.
 
Some specific remarks about how to do the revision steps:
 
If you changed the channels to be removed (because of them having bad data quality) this also means that the manual rejections have to be revised. Please check whether some of the rejections made before can be removed due to the fact that the channel that contained these artifacts has been removed from the data due to bad quality.
 
===ICA-Method 4 (Binary ICA)===
 
The binary ICA is much faster than the one in MATLAB. If you have set the ICA-Method to 4 in your DefSettings, the third step (no interaction) will produce a .bc file in your Data directories. You then have to run ica_linux_i686 on this file.
To process a single participant, cd to your Study directory in a shell, then type
./ica_linux_$(uname -i) < DataFiles/vp_xx/vp_xx.bc
(replace vp_xx with the appropriate directory/filenames).
 
You can use the following two shell commands to run the binary ICA on all (unprocessed) participants:
/scr/neuromusXX/EXPERIMENTS/Your_Study_Directory
for F in $(find DataFiles/*/*.bc); do if [ ! -e $(grep WeightsOutFile ${F} | cut -d" " -f2) ] && [ ! -e $(grep SphereFile ${F} | cut -d" " -f2) ]; then ./ica_linux_$(uname -i) < ${F}; fi; done
 
 
===Comparing two experimental groups===
 
If you want to compare two groups in your experiment, for example to compare musicians with nonmusicians, you have to perform several steps.
 
1. Create a text file with your grouping information
 
Open Calc or Excel (or SPSS or whatever you prefer). You need three columns for most of our experiments, with headers SubjCode, SelSubj, and ExpGroup. List all your Subjects in the column SubjCode like you did it in    case 'N' in the variable 'Settings'. It is important, that all Subjects that are in your grouping file, are also in your DefSettings 'N' list, otherwise the script will not work. In the column SelSubj you can specify  which subjects should be excluded (because of bad data ect). Use 0 for exclude and 1 for include. In the last column ExpGroup you can specify the experimental group. Choose for example 1 for musicians and 2 for        nonmusicians, or 'M' for musicians and 'NM' for nonmusicians (numbers and letters are both ok, it will be used as extension in the name of your average files). Specify all your experimental groups in this way
 
Save the file
Click 'Save as', and save the file again as .csv or .dat file (you can choose the extension by clicking on 'All Formats'). Be sure that you choose tab or semicolon as file delimiter. Otherwise it will not work.
 
The text file should look like this (or seperated by ';' if you choose this as delimiter):
 
SubjCode        SelSubj  ExpGroup
yourstudy_vp01  1        1
yourstudy_vp02  1        1
yourstudy_vp03  1        1
yourstudy_vp04  1        1
yourstudy_vp05  1        1
yourstudy_vp06  0        2
yourstudy_vp07  1        1
yourstudy_vp08  1        2
yourstudy_vp09  1        1
yourstudy_vp10  0        2
yourstudy_vp11  1        1
 
2. Save this file in you experiment directory in the folder Databases/SPSS. When this folder does not exist you can create it.
 
/scr/neuromusXX/EXPERIMENTS/<YourStudy>/Databases/SPSS
 
3. Enter the filename in DefSettings
 
In case 'ExpGrdAvg' right at the end, you will find the variable --> Settings.FleDAT
Set the variable to
 
<tt>Settings.FleDAT = [pwd, filesep, <span style="color: #C00000">'Databases'</span>, filesep, <span style="color: #C00000">'SPSS'</span>, filesep, <span style="color: #C00000">'YourGroupingFile.dat'</span>]</tt>
 
4. Export your Grand Averages
 
When you export your Grand Averages by typing
 
>>ExpGrdAvg
 
A window will pop up asking you: 'Please choose variable to select participants'
Here you choose SelSubj, to select all subjects you want to have in your analysis. All subjects with a 0 in the column under SelSubj in your grouping file will be excluded. This is of course also possible in the DefSettings file, but in this way you have your data complete and can switch Subjects on and off very easily. It is important, that all Subjects that are in your grouping file, are also in your DefSettings 'N' list, otherwise the script will not work.
 
The next window asks you: 'Please choose variable(s) to group participants'
Here you choose ExpGroup, to divide your subjects into the experimental groups you specified in your grouping file.
 
 
==Useful EEGLAB commands and tools for running scripts==
 
>> EEG = pop_loadset()
 
-        Loads a specific dataset (.set) so that you can examine one participant's data at a time. This includes loading sets in order to run scripts for individual participants.
 
-        Now, the set that you are working with will be assigned to: EEG
 
 
>> EEG
 
-        running this command tells you which dataset is currently loaded. It also gives you information about all the fields available under this structure, including comments, events, epochs, chanlocs, etc.
 
-        The Fields under this structure often have subfields of their own. Thus,
 
>> {EEG.event.latency}
 
will return a matrix containing all of the latencies (in samples: divide by *500 to get seconds) of the marked events. The brackets prevent each event from being listed on                    its own line. This is useful in determining if the timing of the EEG recording corresponds to the length of your stimuli. If there is a discrepancy, it could affect your results.
 
>> 'YourStudy'(EEG)
 
-        This command will run the entire script on only one dataset. Additionally, you can use other scripts, such as:
 
>> Calc_AVR(EEG)
 
>> Strg + c
 
-        Typing Ctrl, or Strg and the letter c will stop any process that is running.
 
>> eeglab
 
-        This will open the GUI again, if you need to work with it.
 
>> edit DefSettings.m
 
-        Provided your directory is set correctly, this will allow you to edit DefSettings (or any other script) from the command line. Most Matlab commands work in the same way in EEGLAB, such as 'whos', 'help', and 'exit'.
 
Check single-subject averages (Example from Experiment DevDet VP18)
 
>>load DataFiles/devdet1_VP18/devdet1_VP18.av1 -MAT
 
>>{AVR.setname}'
 
>>help pop_comperp  à shows you all parameters you may set for pop_comperp
 
>>pop_comperp(AVR, 1, [1], [2], 'addavg', 'on', 'subavg', 'on', 'diffavg', 'on', 'diffstd', 'off');
 
 
===Processing of specific Subjects===
 
If you run the script with revision you will be asked which specific subjects you want to revise. However, you will not be asked when you are running the normal analysis. If you never the less want to process only specific subjects, this is how it works:
 
1. open the ProcessSubject.m file by typing in the command line
>>edit ProcessSubject
Set a breakepoint to Line 31 by clicking in the gray area at the left, where the line numbers are depicted.
 
2.Start the script with or without interaction, depending on what the steps are you want to run. So e.g.
>>ProcessSubject(1)
The script will start, but only up to line 31.
 
3. The Subjectlist is already loaded and you can ask for it by typing
K>>SubjList
EEGLAB will show you the Subject List and the number of the columns belonging to the specific subjects. E.g.
 
<pre style="color: green">Columns 273 through 280
 
'021'    '020'    '019'    '018'    '017'    '016'    '015'    '014'
 
Columns 281 through 288
 
'013'    '012'    '011'    '010'    '009'    '008'    '007'    '006'</pre>
 
You know now that Subject 021 is stored in column 273 and Subject 014 in Column 280 etc.
 
4. You have to search for the columns that you are interested in, and change the subject list to only these columns. So if you want to process e.g. subject 021 to 014 you type
 
K>>SubjList=SubjList(273:280)
 
5. The last step is to continue the script
 
K>>dbcont
Now the script will only process the subjects in the columns you specified
 
 
===Processing a subject list backwards===
 
Sometimes it may be useful to process a subject list backwards. For example when you start an analysis on two different computers to process your data more quickly.
 
Carry out steps 1. - 3. from 'Processing of specific subjects'.
 
In step 4. you do not have to give specific columns, but you want to flip the whole subject list. Do this by typing
 
K>>SubjList=fliplr(SubjList)
EEGLAB will show you the new subject list.
 
Now continue the script
K>>dbcont
 
Now the script will process the subject list backwards
 
 
 
==Criteria to remove ICA components==
We have two ways of checking which components to remove. The one way is checking at the headplots, what the scalp distribution is. The other approach is checking in the components, which of them looks like an eye related component (eye blink, eye movement), or ECG or other kind of artifact.
 
Rules:
 
<ul>
  <li>Stop removal at component 10 (after comp. 10).</li>
  <li>Do not remove more than 6 components</li>
  <li>Do not remove a noisy component (ex: this may be the mastoid) unless it has a clear artifact</li>
  <li>Remove only repetitive artifacts</li>
</ul>
 
 
Examples:
 
Typical patterns of artifact that we should remove:
1) Typical artifact for eye-blink (many dispersed red spots)  Think of it orthogonally, the major component, the longer direction of the eye blink will load on the component 1 and a bit of vertical component in another number.
[[File:typical_eyeBlink_artifact.jpg]]
 
2) Horizontal eye movement 
[[File:hor_eye.jpg]]
 
3) ECG: Typical peaks at around 10Hz
May be useful to set the scale or the raw data @ 100 mV so that the heart-bit can be viewed.
[[File:ECG.jpg]]
 
NOTE: always check that eye artifact in  the raw data coincide with the eye artifact as captured in the component you are planning to remove, as shown in the figure below
[[File:check_comp_rawdata.jpg]]
 
 
Videos:
 
1) Identifying ICA components for removal [https://drive.google.com/file/d/1N4tGm-0pd8q6EKNCB2JUtm_06kzK5UiE/view?usp=sharing Sebastian_video_1] and [https://drive.google.com/file/d/1cHrXk76fXK9xrnPZEpHTn_pTrN-sFCqe/view?usp=sharing Sebastian_video_2]
2) Description of the ICA capturing the typical artifact of the blinks [https://drive.google.com/file/d/1YxZCaHezzLi4M89YrO4lzLQoiPwr-QFN/view?usp=sharing Sebastian_video_3]
 
 
==SPSS Tips==
 
In order to import .dat file in SPSS:
Open SPSS, File > Import Data > Text Data > select the file you want to import and press OK. Then the Text Import Wizard window opens where in Steps 1,2,3,5 just press Next. In Step 4: tick the Semicolon, Remove leading spaces from string values and Remove trailing spaces from string values. Uncheck the Space. In Step 6: In "Would you like to paste the syntax?" select Yes and press Finish. 
 
Analysis:
Analyze > General Linear Model > Repeated Measures Compare 2 conditions
 
==Further information (lecture slides from SJ)==
[https://wiki.uib.no/neuromus/img_auth.php/f/fc/EEGLAB_-_Introduction_1_%282013-01-24%29.pdf EEGLAB - Introduction 1]
[https://wiki.uib.no/neuromus/img_auth.php/a/a3/EEGLAB_-_Introduction_2_%282013-02-14%29.pdf EEGLAB - Introduction 2]
[https://wiki.uib.no/neuromus/img_auth.php/c/c0/EEGLAB_-_Introduction_3_%282012-02-09%29.pdf EEGLAB - Introduction 3]
[https://wiki.uib.no/neuromus/img_auth.php/a/a8/EEGLAB_-_Introduction_4_%282012-02-16%29.pdf EEGLAB - Introduction 4]

Latest revision as of 10:31, 30 November 2022